{
  "schemaVersion": "1.4.0",
  "generated": "2026-11-19T22:48:13.247Z",
  "licence": "PolyForm-Noncommercial-1.0.0",
  "counts": {
    "entries": 199,
    "kits": 5,
    "tones": 3,
    "looks": 14,
    "playbooks": 14
  },
  "rules": {
    "file": "rules.md",
    "sha256": "79e578f49956c30813f8025ca2334f5fb7ea79a8cac088c1d3102a5a18ec4eab"
  },
  "roles": [
    {
      "id": "foundation",
      "name": "Foundation",
      "note": "The everyday baseline every app needs and nobody should rebuild: tables, menus, dialogs, fields, tabs, themes, plain charts, loading states."
    },
    {
      "id": "interaction",
      "name": "Interaction",
      "note": "A way to act on things, or the feedback to an act: drag, swipe, hold, throw, springs, sounds, gizmos, game input."
    },
    {
      "id": "hero-visual",
      "name": "Hero visual",
      "note": "A centrepiece people look at: a simulation, a material, a GPU chart, a title moment."
    },
    {
      "id": "system",
      "name": "System",
      "note": "Runtime machinery the app runs on and the user never sees as such: controllers, pathfinding, loaders, sync, rendering techniques, quality tiers."
    },
    {
      "id": "tooling",
      "name": "Tooling",
      "note": "Development and checking, run by the builder rather than shipped to the user: gates, audits, ledgers, checks."
    }
  ],
  "stacks": [
    {
      "id": "dom",
      "name": "DOM",
      "note": "HTML, CSS and SVG elements."
    },
    {
      "id": "canvas2d",
      "name": "Canvas 2D",
      "note": "A Canvas 2D context."
    },
    {
      "id": "three",
      "name": "three.js",
      "note": "three.js (WebGPURenderer and TSL; its WebGL 2 backend where the entry’s api says webgpu+webgl). The module imports three; match the version in needs.three."
    },
    {
      "id": "webgpu",
      "name": "raw WebGPU",
      "note": "Its own WebGPU device and WGSL, no three.js."
    },
    {
      "id": "headless",
      "name": "headless",
      "note": "Draws nothing: logic, maths or data that your app (or the demo) draws."
    }
  ],
  "tones": [
    {
      "id": "strict",
      "name": "Strict",
      "summary": "Sober and exact: data first, nothing moves unless it means something, dense and quiet. For finance, operations, monitoring and tools people use all day.",
      "motion": "minimal",
      "density": "compact",
      "sound": false,
      "flourish": "none",
      "characters": [
        "calm"
      ],
      "looks": [
        "boardroom",
        "brutalist",
        "ink",
        "orrery"
      ]
    },
    {
      "id": "refined",
      "name": "Refined",
      "summary": "Crafted and calm: generous space, short eased motion, one signature moment per screen. For premium products, editorial pages and presentations.",
      "motion": "subtle",
      "density": "comfortable",
      "sound": false,
      "flourish": "accents",
      "characters": [
        "calm",
        "balanced"
      ],
      "looks": [
        "atmos",
        "atrium",
        "glass",
        "holo",
        "ink",
        "orrery",
        "specimen",
        "undertow"
      ]
    },
    {
      "id": "playful",
      "name": "Playful",
      "summary": "Tactile and alive: springs that overshoot, things to poke, sound on, decoration welcome. For games, consumer apps, campaigns and anything meant to delight.",
      "motion": "lively",
      "density": "airy",
      "sound": true,
      "flourish": "free",
      "characters": [
        "balanced",
        "expressive"
      ],
      "looks": [
        "comic",
        "fling",
        "grid",
        "splash"
      ]
    }
  ],
  "looks": [
    {
      "id": "atmos",
      "name": "Atmos",
      "description": "A control room over a lit map: frosted navy glass panels above a night relief of a northern coast, with cyan lanes, moving traffic, beams standing on the hubs and events flaring in coral; a pale daylight map in the light mode. For dashboards and presentations about places, routes, trails and events.",
      "modes": [
        "light",
        "dark"
      ],
      "scheme": "dark",
      "tones": [
        "refined"
      ],
      "suits": [
        "dashboard",
        "product-presentation"
      ],
      "tags": [
        "map",
        "geography",
        "routes",
        "markers",
        "frosted",
        "night",
        "cyan",
        "mono labels",
        "shader backdrop",
        "dark first"
      ],
      "dials": {
        "liveliness": 100,
        "fidelity": 99,
        "density": 50
      },
      "backdrop": {
        "summary": "A relief map of a made-up northern coast seen from above at an angle: lanes of light between twelve hubs with traffic running along them, beams and sonar rings on the hubs, an event flaring every few seconds, swells and glints on the sea, low fog; presses on the page send a ring across the map. A CSS still of the same coast stands in below fidelity 40, under reduced motion and without WebGL2.",
        "draws": "webgl2",
        "from": 40,
        "module": "looks/atmos/backdrop.ts"
      },
      "provenance": {
        "base": "HaTac-ui-mockups styles/atmos: style.css, themes.js, wgsl.js (d5d98b1)",
        "origin": "HaTac-ui-mockups styles/atmos",
        "note": "Ported from the mock-up (its night theme is the dark mode, its day theme the light mode); the owner wanted a little less glow, so the lanes, beams and pools are dimmer and narrower and there is no bloom. The baked real-world relief becomes a procedural coast, so the look names no place; the mock-up’s GPU-drawn panel glass becomes CSS frost."
      },
      "stylesheet": "looks/atmos/look.css",
      "emblem": null,
      "shared": [
        "looks/dials.css",
        "looks/dials.ts"
      ],
      "attribute": "data-look=\"atmos\"",
      "touch": {
        "knobs": [
          {
            "token": "--accent",
            "kind": "colour",
            "note": "Buttons, links, picks and the active marks. Cyan takes navy ink at night and deep blue takes white by day: set --on-accent with it.",
            "hues": {
              "light": {
                "from": "#005d92",
                "fails": [
                  52,
                  82,
                  112,
                  142,
                  172
                ]
              },
              "dark": {
                "from": "#00a0d6",
                "fails": [
                  225,
                  255,
                  285,
                  315,
                  345,
                  15
                ]
              }
            }
          },
          {
            "token": "--on-accent",
            "kind": "colour",
            "note": "Text and icons on the accent.",
            "hues": {
              "light": {
                "from": "#ffffff",
                "fails": []
              },
              "dark": {
                "from": "#03122b",
                "fails": []
              }
            }
          },
          {
            "token": "--at-eyebrow",
            "kind": "colour",
            "note": "The mono labels and the picked tab’s mark. It is text: keep it readable on the panels in each mode.",
            "pairs": [
              [
                "--at-eyebrow",
                "--surface"
              ]
            ],
            "hues": {
              "light": {
                "from": "#005d92",
                "fails": [
                  52,
                  82,
                  112,
                  142,
                  172
                ]
              },
              "dark": {
                "from": "#8eddf9",
                "fails": []
              }
            }
          },
          {
            "token": "--at-road",
            "kind": "colour",
            "note": "The land lanes on the live map. The CSS still keeps its own colours, so stay near the look’s cool blues.",
            "hues": {
              "light": {
                "from": "#005d92",
                "fails": []
              },
              "dark": {
                "from": "#00a0d6",
                "fails": []
              }
            }
          },
          {
            "token": "--at-air-lane",
            "kind": "colour",
            "note": "The bright lanes and their traffic on the live map.",
            "hues": {
              "light": {
                "from": "#00a0d6",
                "fails": []
              },
              "dark": {
                "from": "#8eddf9",
                "fails": []
              }
            }
          },
          {
            "token": "--at-hub",
            "kind": "colour",
            "note": "The hubs, their rings and beams on the live map.",
            "hues": {
              "light": {
                "from": "#00a0d6",
                "fails": []
              },
              "dark": {
                "from": "#8eddf9",
                "fails": []
              }
            }
          },
          {
            "token": "--at-alert",
            "kind": "colour",
            "note": "The event flares: the one warm colour on the map. Keep it warm against the cool lanes.",
            "hues": {
              "light": {
                "from": "#9b1c2e",
                "fails": []
              },
              "dark": {
                "from": "#ef6264",
                "fails": []
              }
            }
          },
          {
            "token": "--at-glow",
            "kind": "number",
            "range": [
              0.3,
              0.85
            ],
            "note": "How strongly the lanes, beams and hubs glow. Kept low on purpose: no bloom."
          },
          {
            "token": "--at-frost-clear",
            "kind": "number",
            "range": [
              0,
              40
            ],
            "unit": "%",
            "note": "How much map shows through the panels at full fidelity."
          },
          {
            "token": "--radius",
            "kind": "length",
            "range": [
              10,
              20
            ],
            "unit": "px",
            "note": "The panels’ corners: softly rounded glass."
          },
          {
            "token": "--radius-sm",
            "kind": "length",
            "range": [
              6,
              14
            ],
            "unit": "px",
            "note": "Fields, buttons and nested parts."
          },
          {
            "token": "--font",
            "kind": "font",
            "note": "The body face: a clean, technical grotesque."
          },
          {
            "token": "--font-display",
            "kind": "font",
            "note": "Titles and the large numerals: light weights of the same grotesque."
          },
          {
            "token": "--mono",
            "kind": "font",
            "note": "The labels: keep it monospace, set in small capitals."
          }
        ],
        "keep": [
          "The lit map behind the glass from fidelity 40: a coast at night with lanes, traffic, beams on the hubs and events flaring; a pale daylight map in the light mode.",
          "Frosted panels with a cool rim, clear enough to show the map, solid at fidelity 0.",
          "Mono capitals for labels and light figures for numbers.",
          "Navy and cyan as the ground, with one warm colour only for events and alerts.",
          "Little glow: thin lanes, narrow beams, no bloom.",
          "A calm ease: things settle in, nothing bounces."
        ],
        "character": [
          "A control room looking down on a lit map at night.",
          "Frosted navy glass over moving lines of light.",
          "Cool cyan for routes and hubs; one warm colour for what needs attention.",
          "Small mono capitals over large, light numerals.",
          "Calm, precise motion, like instruments."
        ],
        "switches": []
      },
      "checker": "harness/look-touch.ts",
      "facts": {
        "contrast": [
          {
            "mode": "light",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 14.57,
            "at": "fidelity 100"
          },
          {
            "mode": "light",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 12.66,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 7.62,
            "at": "fidelity 100, density 100"
          },
          {
            "mode": "light",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 7.05,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 6.65,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 5.77,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 16.61,
            "at": "fidelity 0"
          },
          {
            "mode": "dark",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 19.32,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 10.96,
            "at": "fidelity 0, density 100"
          },
          {
            "mode": "dark",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 6.22,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 5.54,
            "at": "fidelity 0, density 100"
          },
          {
            "mode": "dark",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 6.44,
            "at": "density 100"
          }
        ],
        "palette": {
          "light": {
            "bg": "#dcebf2",
            "surface": "#ffffffb3",
            "surface-2": "#0d234b0b",
            "border": "#0d234b1f",
            "text": "#0d234b",
            "text-2": "#3a5172",
            "text-3": "#3f6a8c",
            "accent": "#005d92",
            "on-accent": "#ffffff",
            "accent-soft": "#005d921f",
            "ok": "#0e7a5c",
            "warn": "#8a5800",
            "bad": "#9b1c2e"
          },
          "dark": {
            "bg": "#050d22",
            "surface": "#0b1d40bd",
            "surface-2": "#8eddf90f",
            "border": "#8eddf929",
            "text": "#ffffff",
            "text-2": "#bfd5e4",
            "text-3": "#8db2cc",
            "accent": "#00a0d6",
            "on-accent": "#03122b",
            "accent-soft": "#00a0d633",
            "ok": "#6fdcb4",
            "warn": "#f2c46d",
            "bad": "#ef6264"
          }
        },
        "motion": {
          "liveliness": 100,
          "keyframes": [
            "atmos-breathe"
          ],
          "backdropMoves": true,
          "stillUnderReducedMotion": true
        },
        "cost": "not measured yet"
      }
    },
    {
      "id": "atrium",
      "name": "Atrium",
      "description": "A bright, friendly common space: a soft daylight wash from the top of the page over a faint square grid, rounded white cards with a whisper of blue round each edge, a rounded sans and calm pastel tints (sky, mint, butter, lavender, coral) for states and picks. Clean and cute enough for presenting across a company, shops and everyday dashboards; a graphite variant for the dark.",
      "modes": [
        "light",
        "dark"
      ],
      "scheme": "light",
      "tones": [
        "refined"
      ],
      "suits": [
        "dashboard",
        "shop",
        "foundations"
      ],
      "tags": [
        "pastel",
        "rounded",
        "daylight",
        "grid",
        "soft shadow",
        "friendly",
        "calm",
        "light first"
      ],
      "dials": {
        "liveliness": 10,
        "fidelity": 10,
        "density": 50
      },
      "backdrop": {
        "summary": "Daylight from the top of the page over a faint 32 px square grid, in CSS. Fidelity brings up pastel pools of light and a few accent dots resting on the grid lines; liveliness lets the pools drift and the dots glide slowly along the lines, like the board’s flow light.",
        "draws": "css",
        "module": null
      },
      "provenance": {
        "base": "SpaciousPro src/theme/atrium.ts, src/theme/variants/atrium.ts (136d467)",
        "origin": null,
        "note": "The Harbour scheme is the light mode and Graphite the dark. The board skin (rounded cards, a fixed accent edge at 12%, a soft glow, a sheen and a tinted header) becomes token shadows and a fill; the board’s backdrop (daylight from the top, a 32 px grid with a soft glow) and its calm flow light (accent dots that slow down at rest) become a CSS backdrop, with the theme’s pastel fills as pools of daylight that come up with fidelity. The font becomes a system stack that prefers the theme’s rounded sans when it is installed."
      },
      "stylesheet": "looks/atrium/look.css",
      "emblem": null,
      "shared": [
        "looks/dials.css",
        "looks/dials.ts"
      ],
      "attribute": "data-look=\"atrium\"",
      "touch": {
        "knobs": [
          {
            "token": "--accent",
            "kind": "colour",
            "note": "Buttons, links, focus, the cards’ edge and glow, the grid’s tint and the gliding dots: a department colour. Set --on-accent with it.",
            "hues": {
              "light": {
                "from": "#2866d6",
                "fails": [
                  309,
                  39,
                  69,
                  99,
                  129,
                  159,
                  189
                ]
              },
              "dark": {
                "from": "#6fa3ff",
                "fails": []
              }
            }
          },
          {
            "token": "--on-accent",
            "kind": "colour",
            "note": "Text and icons on the accent.",
            "hues": {
              "light": {
                "from": "#ffffff",
                "fails": []
              },
              "dark": {
                "from": "#171b22",
                "fails": []
              }
            }
          },
          {
            "token": "--accent-soft",
            "kind": "colour",
            "note": "The soft tint of the accent behind picks and the focus halo. Keep it pale.",
            "pairs": [
              [
                "--text",
                "--accent-soft"
              ]
            ],
            "hues": {
              "light": {
                "from": "#2866d61a",
                "fails": []
              },
              "dark": {
                "from": "#6fa3ff29",
                "fails": []
              }
            }
          },
          {
            "token": "--radius",
            "kind": "length",
            "range": [
              10,
              20
            ],
            "unit": "px",
            "note": "The cards’ corners: soft and friendly, never square."
          },
          {
            "token": "--radius-sm",
            "kind": "length",
            "range": [
              6,
              12
            ],
            "unit": "px",
            "note": "Fields, buttons, pills and nested parts."
          },
          {
            "token": "--font",
            "kind": "font",
            "note": "The body face: a rounded, friendly sans."
          },
          {
            "token": "--font-display",
            "kind": "font",
            "note": "Titles: the same rounded sans, or one close to it."
          }
        ],
        "keep": [
          "Daylight from the top of the page over a faint square grid.",
          "Rounded white cards with a whisper of the accent round each edge; graphite cards in the dark.",
          "Calm pastels (sky, mint, butter, lavender, coral) for picks and the soft states.",
          "A rounded, friendly sans.",
          "Quiet by default: little lift and slow, small motion."
        ],
        "character": [
          "A bright, friendly common space in daylight.",
          "Soft white cards with rounded corners on a faint grid.",
          "Calm pastel tints in place of loud colour.",
          "A few points of light gliding slowly along the grid lines.",
          "Clean and a little cute, never loud."
        ],
        "switches": []
      },
      "checker": "harness/look-touch.ts",
      "facts": {
        "contrast": [
          {
            "mode": "light",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 15.59,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 14.39,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 6.88,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 5.3,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 5.3,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 4.89,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 13.08,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 14.69,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 8.12,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 6.87,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 6.12,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 6.87,
            "at": "default dials"
          }
        ],
        "palette": {
          "light": {
            "bg": "#f3f6fa",
            "surface": "#ffffff",
            "surface-2": "#f5f7fb",
            "border": "#1628461a",
            "text": "#1b2433",
            "text-2": "#4f5b6e",
            "text-3": "#66728a",
            "accent": "#2866d6",
            "on-accent": "#ffffff",
            "accent-soft": "#2866d61a",
            "ok": "#1d7a51",
            "warn": "#8f5c08",
            "bad": "#b83b31"
          },
          "dark": {
            "bg": "#171b22",
            "surface": "#20252e",
            "surface-2": "#00000038",
            "border": "#e8edf51a",
            "text": "#e8edf5",
            "text-2": "#b4bdcc",
            "text-3": "#8f99aa",
            "accent": "#6fa3ff",
            "on-accent": "#171b22",
            "accent-soft": "#6fa3ff29",
            "ok": "#5fd1a0",
            "warn": "#f0bf5a",
            "bad": "#ef7a70"
          }
        },
        "motion": {
          "liveliness": 10,
          "keyframes": [
            "atrium-drift",
            "atrium-flow"
          ],
          "backdropMoves": false,
          "stillUnderReducedMotion": true
        },
        "cost": "not measured yet"
      }
    },
    {
      "id": "boardroom",
      "name": "Boardroom",
      "description": "A printed report: ivory stock, navy ink, serif headings over a plain sans, small tracked capitals for labels, hairline rules and square corners; almost nothing moves. Clean and to the point for dashboards and everyday tools; a navy night variant for the dark.",
      "modes": [
        "light",
        "dark"
      ],
      "scheme": "light",
      "tones": [
        "strict"
      ],
      "suits": [
        "dashboard",
        "foundations"
      ],
      "tags": [
        "paper",
        "serif headings",
        "hairline",
        "square",
        "navy",
        "print",
        "calm"
      ],
      "dials": {
        "liveliness": 0,
        "fidelity": 5,
        "density": 50
      },
      "backdrop": {
        "summary": "Ivory stock with a fine grain and daylight through office blinds falling from the upper left, in CSS; its strength follows fidelity, and the blinds drift slowly when liveliness is raised.",
        "draws": "css",
        "module": null
      },
      "provenance": {
        "base": "SpaciousPro src/theme/boardroom.ts, src/theme/variants/boardroom.ts (cb3b91a)",
        "origin": "HaTac-ui-mockups styles/boardroom",
        "note": "The Ivory theme as the light mode and Navy night as the dark. The board skin (raised index cards, the paper shader with fibres and raking light, daylight through blinds) becomes token shadows and a CSS backdrop of grain and blind light, both scaled by fidelity; the fonts become system stacks."
      },
      "stylesheet": "looks/boardroom/look.css",
      "emblem": null,
      "shared": [
        "looks/dials.css",
        "looks/dials.ts"
      ],
      "attribute": "data-look=\"boardroom\"",
      "touch": {
        "knobs": [
          {
            "token": "--accent",
            "kind": "colour",
            "note": "The primary button, links, focus and the bar on picked rows: one deep ink by day, a muted metal by night. Set --on-accent with it.",
            "hues": {
              "light": {
                "from": "#1f3a5f",
                "fails": []
              },
              "dark": {
                "from": "#c9a45c",
                "fails": [
                  250,
                  280,
                  340
                ]
              }
            }
          },
          {
            "token": "--on-accent",
            "kind": "colour",
            "note": "Text and icons on the accent.",
            "hues": {
              "light": {
                "from": "#fbf8f1",
                "fails": []
              },
              "dark": {
                "from": "#101a2b",
                "fails": []
              }
            }
          },
          {
            "token": "--radius",
            "kind": "length",
            "range": [
              0,
              4
            ],
            "unit": "px",
            "note": "The cards’ corners: square or nearly."
          },
          {
            "token": "--radius-sm",
            "kind": "length",
            "range": [
              0,
              3
            ],
            "unit": "px",
            "note": "Fields, buttons and nested parts."
          },
          {
            "token": "--font",
            "kind": "font",
            "note": "The body and the chrome: a plain sans."
          },
          {
            "token": "--font-display",
            "kind": "font",
            "note": "Headings and the masthead: keep it a book serif."
          }
        ],
        "keep": [
          "Ivory stock and dark ink by day; navy night stock with a gold accent by night.",
          "Serif headings over a plain sans, with small tracked capitals for labels and column heads.",
          "Hairline rules, square corners and the masthead’s double rule.",
          "Almost nothing moves: state changes answer at once.",
          "The paper’s grain and the light through blinds only as strong as fidelity says."
        ],
        "character": [
          "A printed report on good paper.",
          "Serif headings, small tracked capitals and hairline rules, like a ledger.",
          "Square corners and a strong grid.",
          "One deep ink colour for action, and nothing decorative.",
          "Still and to the point."
        ],
        "switches": []
      },
      "checker": "harness/look-touch.ts",
      "facts": {
        "contrast": [
          {
            "mode": "light",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 16.04,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 14.71,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 8.59,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 10.83,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 10.83,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 9.92,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 12.57,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 13.75,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 7.97,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 7.43,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 6.79,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 7.43,
            "at": "density 100"
          }
        ],
        "palette": {
          "light": {
            "bg": "#f3eee3",
            "surface": "#fbf8f1",
            "surface-2": "#f4efe4",
            "border": "#1c1c1e29",
            "text": "#1c1c1e",
            "text-2": "#4b4842",
            "text-3": "#6a655c",
            "accent": "#1f3a5f",
            "on-accent": "#fbf8f1",
            "accent-soft": "#1f3a5f17",
            "ok": "#2f6440",
            "warn": "#84601c",
            "bad": "#9b3a2e"
          },
          "dark": {
            "bg": "#101a2b",
            "surface": "#152238",
            "surface-2": "#1a2840",
            "border": "#ebe4d229",
            "text": "#ebe4d2",
            "text-2": "#bdb7a8",
            "text-3": "#9c9a92",
            "accent": "#c9a45c",
            "on-accent": "#101a2b",
            "accent-soft": "#c9a45c21",
            "ok": "#8cc4a2",
            "warn": "#dcb96e",
            "bad": "#ee9a86"
          }
        },
        "motion": {
          "liveliness": 0,
          "keyframes": [
            "boardroom-blinds"
          ],
          "backdropMoves": false,
          "stillUnderReducedMotion": true
        },
        "cost": "not measured yet"
      }
    },
    {
      "id": "brutalist",
      "name": "Brutalist",
      "description": "No corners, thick black lines, monospace everything, one flat electric-blue accent, a visible grid and hard shadows; motion is instant. Suits tools, dashboards and anything that should feel built rather than styled.",
      "modes": [
        "light",
        "dark"
      ],
      "scheme": "light",
      "tones": [
        "strict"
      ],
      "suits": [
        "dashboard",
        "foundations"
      ],
      "tags": [
        "square",
        "monospace",
        "high contrast",
        "hard shadows",
        "grid",
        "no motion"
      ],
      "dials": {
        "liveliness": 0,
        "fidelity": 10,
        "density": 50
      },
      "backdrop": null,
      "provenance": {
        "base": null,
        "origin": null,
        "note": "Written for the library."
      },
      "stylesheet": "looks/brutalist/look.css",
      "emblem": null,
      "shared": [
        "looks/dials.css",
        "looks/dials.ts"
      ],
      "attribute": "data-look=\"brutalist\"",
      "touch": {
        "knobs": [
          {
            "token": "--accent",
            "kind": "colour",
            "note": "The one colour: buttons, focus, picks and the calendar’s day. Keep it flat and saturated, and set --on-accent with it.",
            "hues": {
              "light": {
                "from": "#0000ff",
                "fails": [
                  300,
                  330,
                  0,
                  30,
                  60,
                  90,
                  120,
                  150,
                  180,
                  210
                ]
              },
              "dark": {
                "from": "#7c7cff",
                "fails": []
              }
            }
          },
          {
            "token": "--on-accent",
            "kind": "colour",
            "note": "Text and icons on the accent: white or black.",
            "hues": {
              "light": {
                "from": "#ffffff",
                "fails": []
              },
              "dark": {
                "from": "#000000",
                "fails": []
              }
            }
          },
          {
            "token": "--font",
            "kind": "font",
            "note": "Every face at once (the mono and the titles follow it): keep it monospace."
          },
          {
            "token": "--brut-cell",
            "kind": "length",
            "range": [
              16,
              40
            ],
            "unit": "px",
            "note": "The page grid’s cell."
          }
        ],
        "keep": [
          "No rounded corners anywhere.",
          "Thick ink lines round every box: black by day, white by night.",
          "Monospace for everything, with labels in tracked capitals.",
          "One flat, saturated accent and hard offset shadows; no soft shadow, glow or blur.",
          "Motion is instant.",
          "The visible square grid on the page."
        ],
        "character": [
          "Built, not styled: every part is a box with a thick line.",
          "Monospace type and loud capitals.",
          "One flat, saturated colour against black and white.",
          "Hard shadows that buttons press into.",
          "Nothing eases or fades: it changes at once."
        ],
        "switches": []
      },
      "checker": "harness/look-touch.ts",
      "facts": {
        "contrast": [
          {
            "mode": "light",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 21,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 18.19,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 14.16,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 8.59,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 8.59,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 7.44,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 19.17,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 21,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 13.58,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 6.18,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 5.64,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 6.18,
            "at": "default dials"
          }
        ],
        "palette": {
          "light": {
            "bg": "#efefe9",
            "surface": "#ffffff",
            "surface-2": "#e9e9e3",
            "border": "#000000",
            "text": "#000000",
            "text-2": "#2b2b2b",
            "text-3": "#555555",
            "accent": "#0000ff",
            "on-accent": "#ffffff",
            "accent-soft": "#d6d6ff",
            "ok": "#00703a",
            "warn": "#8a5300",
            "bad": "#d10000"
          },
          "dark": {
            "bg": "#000000",
            "surface": "#0f0f0f",
            "surface-2": "#1c1c1c",
            "border": "#ffffff",
            "text": "#ffffff",
            "text-2": "#d9d9d9",
            "text-3": "#a6a6a6",
            "accent": "#7c7cff",
            "on-accent": "#000000",
            "accent-soft": "#23235c",
            "ok": "#3ddc84",
            "warn": "#ffc21a",
            "bad": "#ff5a5a"
          }
        },
        "motion": {
          "liveliness": 0,
          "keyframes": [],
          "backdropMoves": false,
          "stillUnderReducedMotion": true
        },
        "cost": "not measured yet"
      }
    },
    {
      "id": "comic",
      "name": "Comic",
      "description": "Thick ink outlines, hard offset shadows, halftone dots and shouty display titles; popovers and tooltips are speech balloons that bounce in. Paper and primary colours by day, night ink and neon by night.",
      "modes": [
        "light",
        "dark"
      ],
      "scheme": "light",
      "tones": [
        "playful"
      ],
      "suits": [
        "game",
        "product-presentation"
      ],
      "tags": [
        "playful",
        "bold",
        "halftone",
        "hard shadows",
        "speech balloons",
        "bouncy motion"
      ],
      "dials": {
        "liveliness": 70,
        "fidelity": 40,
        "density": 50
      },
      "backdrop": null,
      "provenance": {
        "base": null,
        "origin": null,
        "note": "Written for the library."
      },
      "stylesheet": "looks/comic/look.css",
      "emblem": null,
      "shared": [
        "looks/dials.css",
        "looks/dials.ts"
      ],
      "attribute": "data-look=\"comic\"",
      "touch": {
        "knobs": [
          {
            "token": "--accent",
            "kind": "colour",
            "note": "Buttons, links and picks: a primary red by day, a neon pink by night. Set --on-accent with it.",
            "hues": {
              "light": {
                "from": "#d4141e",
                "fails": [
                  27,
                  57,
                  87,
                  117,
                  147,
                  177,
                  207
                ]
              },
              "dark": {
                "from": "#ff3ea5",
                "fails": [
                  238,
                  268
                ]
              }
            }
          },
          {
            "token": "--on-accent",
            "kind": "colour",
            "note": "Text and icons on the accent.",
            "hues": {
              "light": {
                "from": "#ffffff",
                "fails": []
              },
              "dark": {
                "from": "#0b0a1a",
                "fails": []
              }
            }
          },
          {
            "token": "--accent-soft",
            "kind": "colour",
            "note": "Selected and highlighted rows: a solid caption yellow by day. Text sits on it, so keep it light by day.",
            "pairs": [
              [
                "--text",
                "--accent-soft"
              ]
            ],
            "hues": {
              "light": {
                "from": "#ffe14a",
                "fails": [
                  230,
                  260
                ]
              },
              "dark": {
                "from": "#ff3ea53d",
                "fails": []
              }
            }
          },
          {
            "token": "--comic-pop",
            "kind": "colour",
            "note": "The caption boxes. Set --comic-on-pop with it.",
            "pairs": [
              [
                "--comic-on-pop",
                "--comic-pop"
              ]
            ],
            "hues": {
              "light": {
                "from": "#ffe14a",
                "fails": [
                  230,
                  260
                ]
              },
              "dark": {
                "from": "#ffe600",
                "fails": [
                  234,
                  264
                ]
              }
            }
          },
          {
            "token": "--comic-on-pop",
            "kind": "colour",
            "note": "Text on the caption boxes.",
            "pairs": [
              [
                "--comic-on-pop",
                "--comic-pop"
              ]
            ],
            "hues": {
              "light": {
                "from": "#111111",
                "fails": []
              },
              "dark": {
                "from": "#0b0a1a",
                "fails": []
              }
            }
          },
          {
            "token": "--comic-shade",
            "kind": "colour",
            "note": "The hard offset shadows: ink by day, neon by night.",
            "hues": {
              "light": {
                "from": "#111111",
                "fails": []
              },
              "dark": {
                "from": "#19d3f0",
                "fails": []
              }
            }
          },
          {
            "token": "--comic-ring",
            "kind": "colour",
            "note": "The focus ring outside the ink: keep it far from the ink and the accent.",
            "hues": {
              "light": {
                "from": "#1747d9",
                "fails": []
              },
              "dark": {
                "from": "#ffe600",
                "fails": []
              }
            }
          },
          {
            "token": "--comic-dot-loud",
            "kind": "colour",
            "note": "The big ben-day dots on the page and the scrims. Keep it faint.",
            "hues": {
              "light": {
                "from": "#d4141e29",
                "fails": []
              },
              "dark": {
                "from": "#ff3ea533",
                "fails": []
              }
            }
          },
          {
            "token": "--radius",
            "kind": "length",
            "range": [
              4,
              12
            ],
            "unit": "px",
            "note": "The panels’ corners: slightly rounded boxes; balloons keep their own rounder corners."
          },
          {
            "token": "--radius-sm",
            "kind": "length",
            "range": [
              6,
              14
            ],
            "unit": "px",
            "note": "Buttons, fields and nested parts."
          },
          {
            "token": "--line",
            "kind": "length",
            "range": [
              2,
              4
            ],
            "unit": "px",
            "note": "The ink outlines: thick, never a hairline."
          },
          {
            "token": "--font",
            "kind": "font",
            "note": "The body: a hand-lettering face."
          },
          {
            "token": "--font-display",
            "kind": "font",
            "note": "Titles: a heavy, condensed face that shouts."
          }
        ],
        "keep": [
          "Thick ink outlines and hard offset shadows, with no soft shadow.",
          "Halftone dots on the panels and ben-day dots on the page.",
          "Popovers and tooltips as speech balloons with tails toward what they point at.",
          "Lettering for the body, a condensed shouting face for titles, and labels in capitals.",
          "Bouncy entrances and buttons that hop, all of it off under reduced motion.",
          "Paper and primary colours by day; night ink and neon by night."
        ],
        "character": [
          "A page from a comic book.",
          "Ink outlines, hard shadows and halftone dots.",
          "Speech balloons that pop in with a bounce.",
          "Shouting display titles in yellow caption boxes.",
          "Primary colours on paper, or neon on night ink."
        ],
        "switches": []
      },
      "checker": "harness/look-touch.ts",
      "facts": {
        "contrast": [
          {
            "mode": "light",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 18.68,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 17.06,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 12.13,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 5.36,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 5.3,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 4.84,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 16.89,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 18.52,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 12.51,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 6.05,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 5.51,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 6.05,
            "at": "density 100"
          }
        ],
        "palette": {
          "light": {
            "bg": "#fff3cf",
            "surface": "#fffef7",
            "surface-2": "#fff4bf",
            "border": "#1111116b",
            "text": "#111111",
            "text-2": "#353535",
            "text-3": "#555555",
            "accent": "#d4141e",
            "on-accent": "#ffffff",
            "accent-soft": "#ffe14a",
            "ok": "#0a7a32",
            "warn": "#9a5200",
            "bad": "#c00018"
          },
          "dark": {
            "bg": "#0b0a1a",
            "surface": "#17142e",
            "surface-2": "#221d42",
            "border": "#f6efff66",
            "text": "#fff8ea",
            "text-2": "#dcd4ef",
            "text-3": "#aea5c8",
            "accent": "#ff3ea5",
            "on-accent": "#0b0a1a",
            "accent-soft": "#ff3ea53d",
            "ok": "#3ef08a",
            "warn": "#ffd23e",
            "bad": "#ff5a6e"
          }
        },
        "motion": {
          "liveliness": 70,
          "keyframes": [
            "comic-pop-in",
            "comic-wobble-in"
          ],
          "backdropMoves": false,
          "stillUnderReducedMotion": true
        },
        "cost": "not measured yet"
      }
    },
    {
      "id": "fling",
      "name": "Fling",
      "description": "Bubblegum paper with candy clouds and polka dots; cards are glossy jelly sweets, each edged in its own candy colour with a solid lip under it, that flip into place when the page arrives. Round friendly words, chunky toy controls that press down, springs that overshoot, and paper butterflies and soap bubbles drifting behind; a press throws confetti. For games, playful dashboards and product pages.",
      "modes": [
        "light"
      ],
      "scheme": "light",
      "tones": [
        "playful"
      ],
      "suits": [
        "game",
        "dashboard",
        "product-presentation"
      ],
      "tags": [
        "candy",
        "pastel",
        "jelly",
        "toy",
        "springs",
        "flip",
        "confetti",
        "butterflies",
        "bubbles",
        "rounded",
        "canvas backdrop"
      ],
      "dials": {
        "liveliness": 100,
        "fidelity": 80,
        "density": 50
      },
      "backdrop": {
        "summary": "Candy paper: a warm pink wash with soft candy clouds drifting in it and a polka-dot print, in CSS; from fidelity 40 a Canvas 2D layer adds paper butterflies flapping across and soap bubbles rising and popping, and a press on the page throws confetti and hearts from where it landed.",
        "draws": "canvas2d",
        "from": 40,
        "module": "looks/fling/backdrop.ts"
      },
      "provenance": {
        "base": "SpaciousPro src/theme/fling.ts, src/theme/variants/fling.ts, src/theme/feel.ts (bouncy), src/canvas/gpu/backdropCandy.ts (e4a15c4)",
        "origin": "HaTac-ui-mockups styles/fling",
        "note": "The Bubblegum theme, light only (the base has no dark flavour). The board skin (jelly sweets with a lip, gloss and glint; Nunito and Fredoka) becomes token edges, a solid lip shadow and a gloss fill, each card in its own candy; the fonts become rounded system stacks. The mock-up’s flip tiles become cards that flip into place on arrival, menus and toasts that turn over, and dialogs that swing in; its confetti and the base’s butterflies and bubbles become a Canvas 2D backdrop and a CSS burst on every press."
      },
      "stylesheet": "looks/fling/look.css",
      "emblem": null,
      "shared": [
        "looks/dials.css",
        "looks/dials.ts"
      ],
      "attribute": "data-look=\"fling\"",
      "touch": {
        "knobs": [
          {
            "token": "--accent",
            "kind": "colour",
            "note": "The primary button, the picked tab’s pill and the progress stripes. Keep it a deep candy so white text reads on it; set --on-accent and --fl-accent-lip with it.",
            "hues": {
              "light": {
                "from": "#d42a76",
                "fails": [
                  33,
                  63,
                  93,
                  123,
                  153,
                  183,
                  303
                ]
              }
            }
          },
          {
            "token": "--on-accent",
            "kind": "colour",
            "note": "Text and icons on the accent.",
            "hues": {
              "light": {
                "from": "#ffffff",
                "fails": []
              }
            }
          },
          {
            "token": "--fl-accent-lip",
            "kind": "colour",
            "note": "The solid lip under the accent’s buttons: a darker shade of the accent.",
            "hues": {
              "light": {
                "from": "#9e1854",
                "fails": []
              }
            }
          },
          {
            "token": "--fl-candy",
            "kind": "colour",
            "note": "The bright candy: focus rings, the tab ink, picked rows and the confetti’s lead colour. Brighter and lighter than the accent.",
            "hues": {
              "light": {
                "from": "#ff4f9a",
                "fails": []
              }
            }
          },
          {
            "token": "--fl-bright-1",
            "kind": "colour",
            "note": "The first of the five bright candies (pink): the confetti and the butterflies’ wings. Keep the five bright, light and far apart on the wheel.",
            "hues": {
              "light": {
                "from": "#ff5fa2",
                "fails": []
              }
            }
          },
          {
            "token": "--fl-bright-2",
            "kind": "colour",
            "note": "The second bright candy (sky blue).",
            "hues": {
              "light": {
                "from": "#7fd8ff",
                "fails": []
              }
            }
          },
          {
            "token": "--fl-bright-3",
            "kind": "colour",
            "note": "The third bright candy (lemon).",
            "hues": {
              "light": {
                "from": "#ffd75e",
                "fails": []
              }
            }
          },
          {
            "token": "--fl-bright-4",
            "kind": "colour",
            "note": "The fourth bright candy (lilac).",
            "hues": {
              "light": {
                "from": "#b98cff",
                "fails": []
              }
            }
          },
          {
            "token": "--fl-bright-5",
            "kind": "colour",
            "note": "The fifth bright candy (mint).",
            "hues": {
              "light": {
                "from": "#5fe0b4",
                "fails": []
              }
            }
          },
          {
            "token": "--radius",
            "kind": "length",
            "range": [
              16,
              28
            ],
            "unit": "px",
            "note": "The jelly cards’ corners: round and soft, never square."
          },
          {
            "token": "--radius-sm",
            "kind": "length",
            "range": [
              10,
              18
            ],
            "unit": "px",
            "note": "Fields, chips and nested parts; buttons stay pills whatever it is."
          },
          {
            "token": "--font",
            "kind": "font",
            "note": "The body face: a rounded, friendly sans."
          },
          {
            "token": "--font-display",
            "kind": "font",
            "note": "Titles: a chunky rounded display face keeps the toy feel."
          }
        ],
        "keep": [
          "Bubblegum paper behind the content, with candy clouds and polka dots, and from fidelity 40 the butterflies and soap bubbles.",
          "Cream jelly cards, each edged in its own candy with a solid lip under it, at every fidelity.",
          "Chunky toy controls that press down into their lip.",
          "Cards flip into place on arrival, and things land on an overshooting spring.",
          "A press throws confetti.",
          "Light only, in soft pastels with plum ink."
        ],
        "character": [
          "Sweets and toys: glossy jelly surfaces in pastel candy colours.",
          "A solid lip under everything, so controls press down like toy buttons.",
          "Round, friendly words.",
          "Springs that overshoot, cards that flip over, confetti on a press.",
          "Paper butterflies and soap bubbles drifting behind the page."
        ],
        "switches": []
      },
      "checker": "harness/look-touch.ts",
      "facts": {
        "contrast": [
          {
            "mode": "light",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 12.54,
            "at": "fidelity 100, density 100"
          },
          {
            "mode": "light",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 11.22,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 6.56,
            "at": "fidelity 100"
          },
          {
            "mode": "light",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 4.78,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 4.53,
            "at": "fidelity 100"
          },
          {
            "mode": "light",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 4.06,
            "at": "density 100"
          }
        ],
        "palette": {
          "light": {
            "bg": "#ffe6ef",
            "surface": "#fffaf6e2",
            "surface-2": "#fff1f5",
            "border": "#f3cfdc",
            "text": "#4a2142",
            "text-2": "#7a4a6e",
            "text-3": "#8e5f85",
            "accent": "#d42a76",
            "on-accent": "#ffffff",
            "accent-soft": "#ff4f9a26",
            "ok": "#0b7f53",
            "warn": "#a05f00",
            "bad": "#c72a4b"
          }
        },
        "motion": {
          "liveliness": 100,
          "keyframes": [
            "fling-clouds",
            "fling-face",
            "fling-back",
            "fling-show",
            "fling-turn-down",
            "fling-turn-up",
            "fling-pop"
          ],
          "backdropMoves": true,
          "stillUnderReducedMotion": true
        },
        "cost": "not measured yet"
      }
    },
    {
      "id": "glass",
      "name": "Glass",
      "description": "Frosted glass slabs with bright rims over shallow, moving water: pale aqua by day with a teal accent, night water with luminous caustics in the dark. Clean and calm enough for dashboards and bright general pages; the water moves slowly behind the frost.",
      "modes": [
        "light",
        "dark"
      ],
      "scheme": "light",
      "tones": [
        "refined"
      ],
      "suits": [
        "dashboard",
        "foundations"
      ],
      "tags": [
        "translucent",
        "frosted",
        "water",
        "caustics",
        "soft motion",
        "light first",
        "shader backdrop"
      ],
      "dials": {
        "liveliness": 30,
        "fidelity": 80,
        "density": 50
      },
      "backdrop": {
        "summary": "Shallow water seen from above: travelling waves bend a faint dot grid on the floor, mirror the sky and focus sunlight into caustic lines; presses on the page send out ripples. A CSS still of soft caustic lines stands in below fidelity 35, under reduced motion and without WebGL2.",
        "draws": "webgl2",
        "from": 35,
        "module": "looks/glass/backdrop.ts"
      },
      "provenance": {
        "base": "SpaciousPro src/theme/glass.ts, src/theme/variants/glass.ts, src/canvas/gpu/looks/glassWgsl.ts (cb3b91a)",
        "origin": "HaTac-ui-mockups styles/glass",
        "note": "The Daylight theme is the light mode; the dark mode is the library’s earlier glass look recoloured to the base’s Dark glass. The board’s glass slabs (refraction at the rim, worked out in the shader) become frosted panels with backdrop blur; the pool becomes a WebGL2 backdrop whose caustics are now computed from the waves’ own curvature, so they read as water."
      },
      "stylesheet": "looks/glass/look.css",
      "emblem": null,
      "shared": [
        "looks/dials.css",
        "looks/dials.ts"
      ],
      "attribute": "data-look=\"glass\"",
      "touch": {
        "knobs": [
          {
            "token": "--accent",
            "kind": "colour",
            "note": "Buttons, links, focus and picks, and the tint deep in the water. It runs into --gl-accent-2 on the primary; set --on-accent with it.",
            "hues": {
              "light": {
                "from": "#0b7a71",
                "fails": []
              },
              "dark": {
                "from": "#2fd4c2",
                "fails": [
                  233,
                  263,
                  293,
                  323,
                  353
                ]
              }
            }
          },
          {
            "token": "--on-accent",
            "kind": "colour",
            "note": "Text and icons on the accent.",
            "hues": {
              "light": {
                "from": "#ffffff",
                "fails": []
              },
              "dark": {
                "from": "#06201d",
                "fails": []
              }
            }
          },
          {
            "token": "--gl-accent-2",
            "kind": "colour",
            "note": "Where the accent runs to on the primary and picked parts, and the water’s second tint. A neighbour of the accent on the wheel keeps it calm.",
            "hues": {
              "light": {
                "from": "#2563c9",
                "fails": []
              },
              "dark": {
                "from": "#7fb4ff",
                "fails": []
              }
            }
          },
          {
            "token": "--gl-halo",
            "kind": "colour",
            "note": "The soft glow under the accent’s buttons: the accent, about a third see-through.",
            "hues": {
              "light": {
                "from": "#0b7a714d",
                "fails": []
              },
              "dark": {
                "from": "#2fd4c266",
                "fails": []
              }
            }
          },
          {
            "token": "--gl-frost-clear",
            "kind": "number",
            "range": [
              0,
              40
            ],
            "unit": "%",
            "note": "How clear the frost gets at full fidelity: 0 is solid panels, 40 shows the most water through."
          },
          {
            "token": "--radius",
            "kind": "length",
            "range": [
              12,
              22
            ],
            "unit": "px",
            "note": "The slabs’ corners: softly rounded, like cut glass."
          },
          {
            "token": "--radius-sm",
            "kind": "length",
            "range": [
              8,
              14
            ],
            "unit": "px",
            "note": "Fields, buttons and nested parts."
          },
          {
            "token": "--font",
            "kind": "font",
            "note": "The body face: a clean, neutral grotesque."
          },
          {
            "token": "--font-display",
            "kind": "font",
            "note": "Titles: a tighter cut of the same kind of face."
          }
        ],
        "keep": [
          "Shallow water behind the content, moving slowly, with caustic light from fidelity 35 and a still of it below.",
          "Panels of frosted glass with a bright rim, translucent over the water as fidelity rises, so the words always read.",
          "Pale aqua water and white frost by day; night water under smoked glass in the dark.",
          "Calm motion: things float in softly and presses ripple the water.",
          "One cool accent that runs into its neighbour on the primary."
        ],
        "character": [
          "Frosted glass slabs lying over shallow water.",
          "Bright rims and a soft sheen on every panel.",
          "Caustic light moving slowly underneath.",
          "Clean, calm and airy: light first, quiet enough to work in all day."
        ],
        "switches": []
      },
      "checker": "harness/look-touch.ts",
      "facts": {
        "contrast": [
          {
            "mode": "light",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 15.18,
            "at": "fidelity 100"
          },
          {
            "mode": "light",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 13.62,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 8.27,
            "at": "fidelity 100, density 100"
          },
          {
            "mode": "light",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 5.2,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 4.93,
            "at": "fidelity 100, density 100"
          },
          {
            "mode": "light",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 4.42,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 15.23,
            "at": "fidelity 0, density 100"
          },
          {
            "mode": "dark",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 16.62,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 9.9,
            "at": "fidelity 0"
          },
          {
            "mode": "dark",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 9.19,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 9.23,
            "at": "fidelity 0, density 100"
          },
          {
            "mode": "dark",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 10.07,
            "at": "density 100"
          }
        ],
        "palette": {
          "light": {
            "bg": "#e2eff1",
            "surface": "#ffffffba",
            "surface-2": "#1b222b0b",
            "border": "#1b222b1a",
            "text": "#1b222b",
            "text-2": "#424c58",
            "text-3": "#5a6470",
            "accent": "#0b7a71",
            "on-accent": "#ffffff",
            "accent-soft": "#12a29621",
            "ok": "#047857",
            "warn": "#8a5300",
            "bad": "#c0392b"
          },
          "dark": {
            "bg": "#0b131c",
            "surface": "#141c28c2",
            "surface-2": "#ffffff0f",
            "border": "#ffffff1c",
            "text": "#eef2f7",
            "text-2": "#bcc6d2",
            "text-3": "#96a2b1",
            "accent": "#2fd4c2",
            "on-accent": "#06201d",
            "accent-soft": "#2fd4c229",
            "ok": "#4ade9a",
            "warn": "#fcd34d",
            "bad": "#ff8a73"
          }
        },
        "motion": {
          "liveliness": 30,
          "keyframes": [],
          "backdropMoves": true,
          "stillUnderReducedMotion": true
        },
        "cost": "not measured yet"
      }
    },
    {
      "id": "grid",
      "name": "Grid",
      "description": "A dark world of light lines: dark glass panels with glowing cyan edges and corner brackets, wide techno capitals and an amber second colour, over an endless floor of light-grid glass that glides toward a skyline of lit towers, with racing light trails, pulses and falling data. A showcase look for launches, games and product stories, not for everyday dashboards.",
      "modes": [
        "dark"
      ],
      "scheme": "dark",
      "tones": [
        "playful"
      ],
      "suits": [
        "product-presentation"
      ],
      "tags": [
        "neon",
        "light lines",
        "grid floor",
        "corner brackets",
        "glass",
        "cyan",
        "amber",
        "wide capitals",
        "shader backdrop",
        "showcase"
      ],
      "dials": {
        "liveliness": 95,
        "fidelity": 90,
        "density": 50
      },
      "backdrop": {
        "summary": "An endless floor of black glass with a cyan light grid, gliding toward a skyline of light-line towers and a column of light: light cycles race along lanes far off in cyan and amber, pulses run out across the floor, data rain falls and splashes where it lands, and presses on the page send rings across the floor. A CSS still of the grid in perspective with its skyline stands in below fidelity 40, under reduced motion and without WebGL2.",
        "draws": "webgl2",
        "from": 40,
        "module": "looks/grid/backdrop.ts"
      },
      "provenance": {
        "base": "HaTac-ui-mockups styles/grid: style.css, gfx.js (4fe0e83)",
        "origin": "HaTac-ui-mockups styles/grid; SpaciousPro src/theme/grid.ts, src/theme/variants/grid.ts (9463392)",
        "note": "The owner found the mock-up the stronger of the two, so it is the base: its palette, walls, brackets, trace and the world shader. From the board app it takes the feel (a crisp ease, square 2 to 4 px corners) and the token names. The walls stand flat here (the mock-up tilts the side columns in 3D), and the world drops the mock-up’s own scene (gates, searchlight, chart pillars) but keeps the floor, the towers, the trails, the pulses and the data rain."
      },
      "stylesheet": "looks/grid/look.css",
      "emblem": null,
      "shared": [
        "looks/dials.css",
        "looks/dials.ts"
      ],
      "attribute": "data-look=\"grid\"",
      "touch": {
        "knobs": [
          {
            "token": "--accent",
            "kind": "colour",
            "note": "The light of the world: the walls’ edges, their glow and corner brackets, the scan lines, the trace, buttons, focus glow and picks, the glowing capitals and the lines of the drawn world. Keep it bright on the near black; set --on-accent with it so text on it still reads. The still’s lines keep the look’s cyan.",
            "hues": {
              "dark": {
                "from": "#41f2ff",
                "fails": [
                  244
                ]
              }
            }
          },
          {
            "token": "--on-accent",
            "kind": "colour",
            "note": "Text and icons on the accent: a near black.",
            "hues": {
              "dark": {
                "from": "#001014",
                "fails": []
              }
            }
          },
          {
            "token": "--gd-other",
            "kind": "colour",
            "note": "The world’s second colour: the far light trails and the odd tower (amber). Keep it warm against the cyan lines and as bright.",
            "hues": {
              "dark": {
                "from": "#ff8f1f",
                "fails": []
              }
            }
          },
          {
            "token": "--gd-arm",
            "kind": "length",
            "range": [
              10,
              20
            ],
            "unit": "px",
            "note": "How long the corner brackets’ arms are."
          },
          {
            "token": "--radius",
            "kind": "length",
            "range": [
              0,
              4
            ],
            "unit": "px",
            "note": "The walls’ corners: square or nearly."
          },
          {
            "token": "--radius-sm",
            "kind": "length",
            "range": [
              0,
              3
            ],
            "unit": "px",
            "note": "Fields, buttons and nested parts."
          },
          {
            "token": "--font",
            "kind": "font",
            "note": "The body face: a technical sans."
          },
          {
            "token": "--font-display",
            "kind": "font",
            "note": "Titles: a wide, geometric techno face for the capitals."
          }
        ],
        "keep": [
          "The endless floor of light-grid glass gliding toward a skyline of lit towers, from fidelity 40, with its still below.",
          "Dark glass walls with thin glowing cyan edges and a corner bracket at each corner, at every fidelity.",
          "Wide tracked capitals for headings, buttons and tabs.",
          "Cyan light lines on near black, with amber as the second colour.",
          "Square corners and a crisp ease."
        ],
        "character": [
          "A dark world drawn in lines of light.",
          "Walls of dark glass with glowing edges and corner brackets.",
          "Wide, glowing techno capitals.",
          "Light trails racing across an endless grid floor toward a lit skyline.",
          "A showcase: loud, fast and crisp."
        ],
        "switches": []
      },
      "checker": "harness/look-touch.ts",
      "facts": {
        "contrast": [
          {
            "mode": "dark",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 17.1,
            "at": "fidelity 0, density 100"
          },
          {
            "mode": "dark",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 18.36,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 12.06,
            "at": "fidelity 0, density 100"
          },
          {
            "mode": "dark",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 14.18,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 13.89,
            "at": "fidelity 0"
          },
          {
            "mode": "dark",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 14.92,
            "at": "density 100"
          }
        ],
        "palette": {
          "dark": {
            "bg": "#00060a",
            "surface": "#03121bba",
            "surface-2": "#41f2ff0d",
            "border": "#41f2ff4d",
            "text": "#dcf8ff",
            "text-2": "#a6d6e2",
            "text-3": "#7fb0bf",
            "accent": "#41f2ff",
            "on-accent": "#001014",
            "accent-soft": "#41f2ff29",
            "ok": "#5dffb4",
            "warn": "#ff8f1f",
            "bad": "#ff5a4a"
          }
        },
        "motion": {
          "liveliness": 95,
          "keyframes": [
            "grid-run",
            "grid-trace"
          ],
          "backdropMoves": true,
          "stillUnderReducedMotion": true
        },
        "cost": "not measured yet"
      }
    },
    {
      "id": "holo",
      "name": "Holo",
      "description": "A calm holographic console: deep navy, dark glass panels with a faint hairline grid, lit cyan edges and corner brackets, small tracked capitals for headings and monospace figures, over a slow field of cyan and violet light with a dot lattice that brightens near the pointer. Clean and futuristic, quiet enough for high-tech dashboards that are looked at all day.",
      "modes": [
        "dark"
      ],
      "scheme": "dark",
      "tones": [
        "refined"
      ],
      "suits": [
        "dashboard"
      ],
      "tags": [
        "holographic",
        "dark glass",
        "cyan",
        "corner brackets",
        "hairline grid",
        "monospace figures",
        "futuristic",
        "shader backdrop"
      ],
      "dials": {
        "liveliness": 50,
        "fidelity": 70,
        "density": 50
      },
      "backdrop": {
        "summary": "A field of light behind the console: deep navy, two slow bands of cyan and violet light warped by noise (magenta where they cross), a 22 px dot lattice that brightens near the pointer and inside the bands, a ping of light where the page is pressed, and a vignette. A CSS still of the same bands and lattice stands in below fidelity 35, under reduced motion and without WebGL2.",
        "draws": "webgl2",
        "from": 35,
        "module": "looks/holo/backdrop.ts"
      },
      "provenance": {
        "base": "SpaciousPro src/theme/holo.ts, src/canvas/gpu/backdropHolo.ts (6e00104)",
        "origin": "HaTac-ui-mockups styles/holo",
        "note": "The Cyan scheme. The board skin (dark glass at 84%, lit edges, glow, corner brackets, a tint and a holographic sheen) becomes token shadows, a frosted fill with the mock-up’s 24 px hairline grid and CSS corner brackets on the cards; the light field (two slow bands of light warped by noise, a dot lattice lit near the pointer, a vignette) becomes a WebGL2 backdrop with a CSS still. The base’s print-in glitch, drones and pointer trail are left out: this is the calm one."
      },
      "stylesheet": "looks/holo/look.css",
      "emblem": null,
      "shared": [
        "looks/dials.css",
        "looks/dials.ts"
      ],
      "attribute": "data-look=\"holo\"",
      "touch": {
        "knobs": [
          {
            "token": "--accent",
            "kind": "colour",
            "note": "The light of the console: buttons, focus, the panels’ lit edges, brackets and hairline grid all follow it. Keep it bright on the navy; set --on-accent with it.",
            "hues": {
              "dark": {
                "from": "#38e8ff",
                "fails": [
                  247,
                  277
                ]
              }
            }
          },
          {
            "token": "--on-accent",
            "kind": "colour",
            "note": "Text and icons on the accent: a near black.",
            "hues": {
              "dark": {
                "from": "#03121a",
                "fails": []
              }
            }
          },
          {
            "token": "--hl-field-band",
            "kind": "colour",
            "note": "The light in the field’s bands behind the console. Set it near the accent so the console and its field glow alike.",
            "hues": {
              "dark": {
                "from": "#38e8ff",
                "fails": []
              }
            }
          },
          {
            "token": "--hl-field-cross",
            "kind": "colour",
            "note": "Where the two bands cross (magenta): a second hue, sparingly seen.",
            "hues": {
              "dark": {
                "from": "#ff4fb8",
                "fails": []
              }
            }
          },
          {
            "token": "--radius",
            "kind": "length",
            "range": [
              0,
              4
            ],
            "unit": "px",
            "note": "The panels’ corners: square or nearly, so the brackets sit true."
          },
          {
            "token": "--radius-sm",
            "kind": "length",
            "range": [
              0,
              3
            ],
            "unit": "px",
            "note": "Fields, buttons and nested parts."
          },
          {
            "token": "--font",
            "kind": "font",
            "note": "The face for words and headings: a clean geometric sans."
          },
          {
            "token": "--mono",
            "kind": "font",
            "note": "Figures and values: a monospace keeps the console."
          }
        ],
        "keep": [
          "A slow field of light behind the content, in deep navy with two soft bands and a dot lattice, from fidelity 35, with a still below.",
          "Dark glass panels with a faint hairline grid, lit edges and corner brackets, at every fidelity.",
          "Headings in small tracked capitals after a lit diamond, and figures in a monospace.",
          "One bright light colour on deep navy.",
          "Calm motion: nothing glitches, flashes or circles; things ease in."
        ],
        "character": [
          "A calm holographic console.",
          "Dark glass panels with lit hairline edges and corner brackets.",
          "Small tracked capitals and monospace figures.",
          "A slow field of light behind it that answers the pointer softly.",
          "Clean and futuristic, quiet enough to look at all day."
        ],
        "switches": []
      },
      "checker": "harness/look-touch.ts",
      "facts": {
        "contrast": [
          {
            "mode": "dark",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 15.36,
            "at": "fidelity 0"
          },
          {
            "mode": "dark",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 16.35,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 9.79,
            "at": "fidelity 0"
          },
          {
            "mode": "dark",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 12.81,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 12.61,
            "at": "fidelity 0"
          },
          {
            "mode": "dark",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 13.43,
            "at": "density 100"
          }
        ],
        "palette": {
          "dark": {
            "bg": "#040914",
            "surface": "#081224d8",
            "surface-2": "#00000052",
            "border": "#78beff29",
            "text": "#dceafe",
            "text-2": "#a9bddb",
            "text-3": "#8399ba",
            "accent": "#38e8ff",
            "on-accent": "#03121a",
            "accent-soft": "#38e8ff24",
            "ok": "#5dffa0",
            "warn": "#ffb547",
            "bad": "#ff6b5e"
          }
        },
        "motion": {
          "liveliness": 50,
          "keyframes": [
            "holo-scan"
          ],
          "backdropMoves": true,
          "stillUnderReducedMotion": true
        },
        "cost": "not measured yet"
      }
    },
    {
      "id": "ink",
      "name": "Paper and ink",
      "description": "Warm, faintly grained paper with ink-drawn lines, serif titles, a muted ink-blue accent and slow, quiet fades; in the dark, pale ink on slate. Suits writing, notes and calm reading tools.",
      "modes": [
        "light",
        "dark"
      ],
      "scheme": "light",
      "tones": [
        "refined",
        "strict"
      ],
      "suits": [
        "foundations",
        "product-presentation"
      ],
      "tags": [
        "paper",
        "serif",
        "texture",
        "calm",
        "warm"
      ],
      "dials": {
        "liveliness": 10,
        "fidelity": 30,
        "density": 57
      },
      "backdrop": null,
      "provenance": {
        "base": null,
        "origin": null,
        "note": "Written for the library; density 57 keeps its slightly roomier spacing (it set --density: 1.05 before the dials)."
      },
      "stylesheet": "looks/ink/look.css",
      "emblem": null,
      "shared": [
        "looks/dials.css",
        "looks/dials.ts"
      ],
      "attribute": "data-look=\"ink\"",
      "touch": {
        "knobs": [
          {
            "token": "--accent",
            "kind": "colour",
            "note": "Buttons, links, focus and the lit gauge segments. Keep it a muted, inky colour, never a bright one; set --on-accent with it so text on it still reads.",
            "hues": {
              "light": {
                "from": "#2d4a7a",
                "fails": [
                  67
                ]
              },
              "dark": {
                "from": "#a9bde3",
                "fails": []
              }
            }
          },
          {
            "token": "--on-accent",
            "kind": "colour",
            "note": "Text and icons on the accent: the paper colour by day, slate by night.",
            "hues": {
              "light": {
                "from": "#fbf7ee",
                "fails": []
              },
              "dark": {
                "from": "#151a21",
                "fails": []
              }
            }
          },
          {
            "token": "--radius",
            "kind": "length",
            "range": [
              6,
              12
            ],
            "unit": "px",
            "note": "The corners the drawn ones don’t reach: small and soft, never round."
          },
          {
            "token": "--radius-sm",
            "kind": "length",
            "range": [
              2,
              6
            ],
            "unit": "px",
            "note": "Small parts and nested ones. Keep it a single length: components do calc() on it."
          },
          {
            "token": "--font",
            "kind": "font",
            "note": "The body face: a book serif."
          },
          {
            "token": "--font-display",
            "kind": "font",
            "note": "Titles and the gauge’s figures: an old-style serif."
          }
        ],
        "keep": [
          "Warm paper under a faint grain by day, and pale ink on slate by night.",
          "Lines drawn in ink, with slightly uneven corners on the main boxes and a soft echo under the stroke.",
          "Serif type throughout, with quiet italic hints.",
          "One muted, inky accent; warm umber scrims, not grey.",
          "Slow, quiet fades with no overshoot, and nothing moves at rest."
        ],
        "character": [
          "Writing on warm, faintly grained paper.",
          "Lines that look drawn with a pen: a shade darker, a little uneven at the corners.",
          "Book serifs, an old-style face for titles, italic for asides.",
          "One muted ink colour, and quiet fades instead of motion.",
          "By night, chalky ink on slate."
        ],
        "switches": []
      },
      "checker": "harness/look-touch.ts",
      "facts": {
        "contrast": [
          {
            "mode": "light",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 15.65,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 13.47,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 9.25,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 8.28,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 8.28,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 7.13,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 11.96,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 13.47,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 7.69,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 9.22,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 7.92,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 8.93,
            "at": "default dials"
          }
        ],
        "palette": {
          "light": {
            "bg": "#eee6d5",
            "surface": "#fbf7ee",
            "surface-2": "#f4eddd",
            "border": "#2821183d",
            "text": "#221d16",
            "text-2": "#4a4236",
            "text-3": "#6b6151",
            "accent": "#2d4a7a",
            "on-accent": "#fbf7ee",
            "accent-soft": "#2d4a7a1c",
            "ok": "#3b6634",
            "warn": "#85560f",
            "bad": "#a1302a"
          },
          "dark": {
            "bg": "#191d22",
            "surface": "#22272e",
            "surface-2": "#2a3038",
            "border": "#e8e2d333",
            "text": "#ebe5d6",
            "text-2": "#c0b9a9",
            "text-3": "#a09989",
            "accent": "#a9bde3",
            "on-accent": "#151a21",
            "accent-soft": "#a9bde324",
            "ok": "#9cc98f",
            "warn": "#e2b866",
            "bad": "#ec9488"
          }
        },
        "motion": {
          "liveliness": 10,
          "keyframes": [],
          "backdropMoves": false,
          "stillUnderReducedMotion": true
        },
        "cost": "not measured yet"
      }
    },
    {
      "id": "orrery",
      "name": "Orrery",
      "description": "Engraved brass on an olive night: hairline rules, square corners, serif titles, tracked small capitals and a faint engraved plate behind the page, with a small GPU globe and its orbits as an emblem. Quiet, precise and a little otherworldly; suits dashboards, reports and tools that measure. Dark first, with a parchment day folio.",
      "modes": [
        "dark",
        "light"
      ],
      "scheme": "dark",
      "tones": [
        "strict",
        "refined"
      ],
      "suits": [
        "dashboard",
        "product-presentation"
      ],
      "tags": [
        "brass",
        "serif",
        "hairline",
        "instrument",
        "dark first",
        "GPU emblem"
      ],
      "dials": {
        "liveliness": 30,
        "fidelity": 60,
        "density": 50
      },
      "backdrop": null,
      "provenance": {
        "base": null,
        "origin": null,
        "note": "Written for the library."
      },
      "stylesheet": "looks/orrery/look.css",
      "emblem": "looks/orrery/emblem.ts",
      "shared": [
        "looks/dials.css",
        "looks/dials.ts"
      ],
      "attribute": "data-look=\"orrery\"",
      "touch": {
        "knobs": [
          {
            "token": "--accent",
            "kind": "colour",
            "note": "The brass: primary fills, picked tabs and days, focus, the rules round floating plates and the emblem’s rulings. Keep it a metal or an earth colour; set --on-accent with it so text on it still reads.",
            "hues": {
              "dark": {
                "from": "#dfbd7f",
                "fails": []
              },
              "light": {
                "from": "#6b501c",
                "fails": []
              }
            }
          },
          {
            "token": "--on-accent",
            "kind": "colour",
            "note": "Text and icons on the accent.",
            "hues": {
              "dark": {
                "from": "#161b12",
                "fails": []
              },
              "light": {
                "from": "#fbf6e8",
                "fails": []
              }
            }
          },
          {
            "token": "--orr-brass-2",
            "kind": "colour",
            "note": "The second, darker brass: gauge bezels and metal. Keep it a shade of the accent.",
            "hues": {
              "dark": {
                "from": "#b8935a",
                "fails": []
              },
              "light": {
                "from": "#8c6a2c",
                "fails": []
              }
            }
          },
          {
            "token": "--radius",
            "kind": "length",
            "range": [
              0,
              3
            ],
            "unit": "px",
            "note": "Panels: square or nearly, as an instrument is cut."
          },
          {
            "token": "--radius-sm",
            "kind": "length",
            "range": [
              0,
              2
            ],
            "unit": "px",
            "note": "Fields, buttons, tooltips and the picked tab’s rule."
          },
          {
            "token": "--font-display",
            "kind": "font",
            "note": "Titles, the brand, dialog titles and the gauges’ figures: a classical book serif."
          }
        ],
        "keep": [
          "Engraved brass on an olive night, with a parchment folio as its daylight twin.",
          "Hairline rules and square corners, with registration marks at the top corners of panels.",
          "Serif titles and labels in tracked small capitals, with tabular figures.",
          "The faint engraved plate and the olive glow behind the page.",
          "Every state repaints only: a colour, a hairline or an inset ring; nothing moves when something is picked.",
          "Dials printed, not lit: no glows on the gauges."
        ],
        "character": [
          "A precision instrument set into an old star atlas.",
          "Brass on an olive night: hairlines, square corners, crosshair marks at the corners.",
          "Classical serif titles over small capitals spaced wide.",
          "States engrave rather than move: a brass rule, an inset ring.",
          "A faint engraved plate of orbits and ticks behind everything."
        ],
        "switches": []
      },
      "checker": "harness/look-touch.ts",
      "facts": {
        "contrast": [
          {
            "mode": "dark",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 13.64,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 14.88,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 8.56,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 9.77,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 9.29,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 10.13,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 14.93,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 13.17,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 7.87,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 6.97,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 6.84,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 6.04,
            "at": "density 100"
          }
        ],
        "palette": {
          "dark": {
            "bg": "#111715",
            "surface": "#18201c",
            "surface-2": "#1f2823",
            "border": "#96a47c3d",
            "text": "#f0e8d6",
            "text-2": "#b4bdaa",
            "text-3": "#9aa494",
            "accent": "#dfbd7f",
            "on-accent": "#161b12",
            "accent-soft": "#dfbd7f1f",
            "ok": "#92c4a6",
            "warn": "#ecb95f",
            "bad": "#f08d78"
          },
          "light": {
            "bg": "#ece6d4",
            "surface": "#f8f4e7",
            "surface-2": "#efe8d4",
            "border": "#3a402433",
            "text": "#1b2119",
            "text-2": "#464e40",
            "text-3": "#5b6253",
            "accent": "#6b501c",
            "on-accent": "#fbf6e8",
            "accent-soft": "#6b501c1a",
            "ok": "#2b6a4c",
            "warn": "#855600",
            "bad": "#b02a1e"
          }
        },
        "motion": {
          "liveliness": 30,
          "keyframes": [],
          "backdropMoves": false,
          "stillUnderReducedMotion": true
        },
        "cost": "not measured yet"
      }
    },
    {
      "id": "specimen",
      "name": "Specimen",
      "description": "Living cells in a containment tank: every panel is a cell whose glowing membrane wobbles and runs into its neighbours’ where they come close, in a deep green fluid lit from above, with caustics, slow clouds and drifting motes, a scale etched down the glass, and a small jelly creature that drifts after the pointer and watches it. Dark and bioluminescent first, with a pale-tank light twin. For dashboards and product pages that should feel alive without getting in the way.",
      "modes": [
        "dark",
        "light"
      ],
      "scheme": "dark",
      "tones": [
        "refined"
      ],
      "suits": [
        "dashboard",
        "product-presentation"
      ],
      "tags": [
        "underwater",
        "cells",
        "membranes",
        "bioluminescent",
        "creature",
        "organic",
        "glow",
        "dark first",
        "shader backdrop"
      ],
      "dials": {
        "liveliness": 100,
        "fidelity": 100,
        "density": 50
      },
      "backdrop": {
        "summary": "A containment tank lit from above: caustics, god rays, slow clouds and motes in a deep fluid, the glass darker at its edges with a scale etched down the left; every panel’s membrane drawn round it, wobbling, fusing with close neighbours, livening under the pointer; a jelly creature drifting after the pointer. A CSS still of the lit fluid, clouds and motes stands in below fidelity 40, under reduced motion and without WebGL2.",
        "draws": "webgl2",
        "from": 40,
        "module": "looks/specimen/backdrop.ts"
      },
      "provenance": {
        "base": "SpaciousPro src/theme/specimen.ts (6e00104), src/theme/variants/specimen.ts (df1b5b5), src/canvas/gpu/lookBackdrops.ts tankFluid (094588e), src/fx/specimen.ts (5646c44)",
        "origin": "HaTac-ui-mockups styles/specimen",
        "note": "The Bioluminescent medium is the dark mode and the Albino medium the light one. The base draws the cells over its cards on a board; here the panels are DOM and the backdrop draws the tank, each panel’s membrane round it (one smooth-unioned field, so neighbours fuse across narrow gaps) and the creature behind them, in WebGL2. The creature is the base’s jelly bell and eyes, with tentacles now simulated as trailing chains. Left out: the culture plates (Gray-Scott colonies), the other two media, the chart tissue and the game."
      },
      "stylesheet": "looks/specimen/look.css",
      "emblem": null,
      "shared": [
        "looks/dials.css",
        "looks/dials.ts"
      ],
      "attribute": "data-look=\"specimen\"",
      "touch": {
        "knobs": [
          {
            "token": "--accent",
            "kind": "colour",
            "note": "Buttons, links, picks and the lit tab. The membranes and the creature keep the tank’s own glow; set --on-accent with it so text on it still reads.",
            "hues": {
              "dark": {
                "from": "#2cf5c8",
                "fails": [
                  227,
                  257
                ]
              },
              "light": {
                "from": "#0f7d68",
                "fails": []
              }
            }
          },
          {
            "token": "--on-accent",
            "kind": "colour",
            "note": "Text and icons on the accent.",
            "hues": {
              "dark": {
                "from": "#02110d",
                "fails": []
              },
              "light": {
                "from": "#ffffff",
                "fails": []
              }
            }
          },
          {
            "token": "--sp-glow",
            "kind": "colour",
            "note": "The tank’s glow: the membranes round every cell and their glow, the panels’ lit line, the lit tab, the halo under the primary, the glass’s rim and scale, and the light in the fluid. Keep it luminous and apart from the creature’s colours, which stay the look’s own, as do the still’s motes.",
            "hues": {
              "dark": {
                "from": "#2cf5c8",
                "fails": []
              },
              "light": {
                "from": "#138a73",
                "fails": []
              }
            }
          },
          {
            "token": "--radius",
            "kind": "length",
            "range": [
              12,
              24
            ],
            "unit": "px",
            "note": "The cells’ corners, which the drawn membrane follows: soft and organic, never square."
          },
          {
            "token": "--radius-sm",
            "kind": "length",
            "range": [
              6,
              14
            ],
            "unit": "px",
            "note": "Fields and nested parts. Buttons stay pills whatever it is."
          },
          {
            "token": "--font",
            "kind": "font",
            "note": "The body face: a rounded, friendly sans."
          },
          {
            "token": "--font-display",
            "kind": "font",
            "note": "Titles and the brand: a wide geometric display face."
          },
          {
            "token": "--mono",
            "kind": "font",
            "note": "The small etched labels and the tooltip tags: keep it a monospace."
          }
        ],
        "keep": [
          "Every panel a living cell: a glowing membrane round it, a breathing inner leaflet and a nucleus in its fill.",
          "The tank behind the content from fidelity 40: lit fluid, caustics, clouds and motes, membranes that fuse where cells come close.",
          "The small jelly creature that drifts after the pointer and watches it.",
          "Words on calm, dense cytoplasm, and floating panels solid, never on moving water.",
          "Bioluminescent teal and lime on green-black by night; the pale tank with teal membranes and rose nuclei by day.",
          "Pill controls with a jelly squash when pressed."
        ],
        "character": [
          "Living cells in a lit containment tank.",
          "Panels as cells with glowing, wobbling membranes that run together.",
          "A small creature that follows and watches the pointer.",
          "Bioluminescent colour on deep fluid, with a scale etched down the glass.",
          "Small monospace labels, as on a specimen jar."
        ],
        "switches": []
      },
      "checker": "harness/look-touch.ts",
      "facts": {
        "contrast": [
          {
            "mode": "dark",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 16.49,
            "at": "fidelity 0"
          },
          {
            "mode": "dark",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 17.99,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 10.45,
            "at": "fidelity 0, density 100"
          },
          {
            "mode": "dark",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 13.78,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 12.46,
            "at": "fidelity 0, density 100"
          },
          {
            "mode": "dark",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 13.59,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 14.54,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 12.81,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 6.2,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 5.06,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 4.59,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 4.04,
            "at": "default dials"
          }
        ],
        "palette": {
          "dark": {
            "bg": "#03130f",
            "surface": "#041e18d9",
            "surface-2": "#0000004d",
            "border": "#78ffd629",
            "text": "#e2fff5",
            "text-2": "#9fd3c3",
            "text-3": "#6f9d90",
            "accent": "#2cf5c8",
            "on-accent": "#02110d",
            "accent-soft": "#2cf5c824",
            "ok": "#7dffb2",
            "warn": "#ffcf6a",
            "bad": "#ff6b7f"
          },
          "light": {
            "bg": "#dfe8e4",
            "surface": "#f4f7f6d9",
            "surface-2": "#123c320d",
            "border": "#123c3224",
            "text": "#122520",
            "text-2": "#45605a",
            "text-3": "#5a716b",
            "accent": "#0f7d68",
            "on-accent": "#ffffff",
            "accent-soft": "#0f7d681f",
            "ok": "#0f7a52",
            "warn": "#8a5a00",
            "bad": "#c6304e"
          }
        },
        "motion": {
          "liveliness": 100,
          "keyframes": [
            "specimen-motes",
            "specimen-breathe"
          ],
          "backdropMoves": true,
          "stillUnderReducedMotion": true
        },
        "cost": "not measured yet"
      }
    },
    {
      "id": "splash",
      "name": "Splash",
      "description": "Pure colour in motion: a living paint field in six bright dyes moves behind calm canvases, stirred by the pointer and burst by a press. Soft, grainy powder billowing on warm artist’s paper by day; glossy liquid paint with ink smoke at its edges on black by night. Each card’s top edge is dipped in its own dye with drips running down, the primary button is a blob of wet paint, picks are blobs of colour and things splat in on a spring. For showcases, product pages and games.",
      "modes": [
        "light",
        "dark"
      ],
      "scheme": "light",
      "tones": [
        "playful"
      ],
      "suits": [
        "product-presentation",
        "game"
      ],
      "tags": [
        "paint",
        "fluid",
        "colourful",
        "powder",
        "liquid",
        "drips",
        "blobs",
        "springs",
        "frosted",
        "shader backdrop"
      ],
      "dials": {
        "liveliness": 100,
        "fidelity": 100,
        "density": 50
      },
      "backdrop": {
        "summary": "A living paint field: a stable-fluids simulation moves six dyes that four jets throw in round the part of the page in view; the pointer stirs it and a press bursts a ring of colour. Powder on paper by day, glossy liquid paint on black by night. A CSS still of soft, displaced blobs of dye stands in below fidelity 40, under reduced motion and without WebGL2.",
        "draws": "webgl2",
        "from": 40,
        "module": "looks/splash/backdrop.ts"
      },
      "provenance": {
        "base": "HaTac-ui-mockups styles/splash (style.css, themes.js, fluid.js); refined after SpaciousPro src/theme/splash.ts, src/theme/variants/splash.ts (cc858c4)",
        "origin": "HaTac-ui-mockups styles/splash",
        "note": "The mock-up is the stronger source (the owner’s note: its live, painterly fluid motion is the point), so it is ported and refined the Spacious way: the Rainbow palette, Holi powder as the light mode and liquid paint as the dark, its tokens, frosted canvases and springs from the base. The WebGPU paint field becomes a WebGL2 backdrop copied from the splash-paint entry’s fallback passes (no panels, membranes or shadows: the canvases are frosted DOM panels over it); the dipped card edges, drips and wet-paint blobs become CSS masks and border radii; the fonts become system stacks."
      },
      "stylesheet": "looks/splash/look.css",
      "emblem": null,
      "shared": [
        "looks/dials.css",
        "looks/dials.ts"
      ],
      "attribute": "data-look=\"splash\"",
      "touch": {
        "knobs": [
          {
            "token": "--accent",
            "kind": "colour",
            "note": "Buttons, links, focus and picks. The paint keeps its six dyes; set --on-accent with it so text on it still reads.",
            "hues": {
              "light": {
                "from": "#d4106f",
                "fails": [
                  31,
                  61,
                  91,
                  121,
                  151,
                  181,
                  301
                ]
              },
              "dark": {
                "from": "#ff4fa8",
                "fails": [
                  240
                ]
              }
            }
          },
          {
            "token": "--on-accent",
            "kind": "colour",
            "note": "Text and icons on the accent.",
            "hues": {
              "light": {
                "from": "#ffffff",
                "fails": []
              },
              "dark": {
                "from": "#17131c",
                "fails": []
              }
            }
          },
          {
            "token": "--sp-d1",
            "kind": "colour",
            "note": "The first of the six dyes (pink): the paint, the dipped edges and the drips. Keep the six bright and far apart on the wheel.",
            "hues": {
              "light": {
                "from": "#ff2d95",
                "fails": []
              },
              "dark": {
                "from": "#ff2d95",
                "fails": []
              }
            }
          },
          {
            "token": "--sp-d2",
            "kind": "colour",
            "note": "The second dye (blue), and the picked tab’s blob.",
            "hues": {
              "light": {
                "from": "#00c2ff",
                "fails": []
              },
              "dark": {
                "from": "#00c2ff",
                "fails": []
              }
            }
          },
          {
            "token": "--sp-d3",
            "kind": "colour",
            "note": "The third dye (orange).",
            "hues": {
              "light": {
                "from": "#ff8a00",
                "fails": []
              },
              "dark": {
                "from": "#ff8a00",
                "fails": []
              }
            }
          },
          {
            "token": "--sp-d4",
            "kind": "colour",
            "note": "The fourth dye (yellow).",
            "hues": {
              "light": {
                "from": "#ffd400",
                "fails": []
              },
              "dark": {
                "from": "#ffd400",
                "fails": []
              }
            }
          },
          {
            "token": "--sp-d5",
            "kind": "colour",
            "note": "The fifth dye (violet).",
            "hues": {
              "light": {
                "from": "#8a3cff",
                "fails": []
              },
              "dark": {
                "from": "#8a3cff",
                "fails": []
              }
            }
          },
          {
            "token": "--sp-d6",
            "kind": "colour",
            "note": "The sixth dye (green).",
            "hues": {
              "light": {
                "from": "#22d66b",
                "fails": []
              },
              "dark": {
                "from": "#22d66b",
                "fails": []
              }
            }
          },
          {
            "token": "--sp-clear",
            "kind": "number",
            "range": [
              0,
              24
            ],
            "unit": "%",
            "note": "How much paint shows through the canvases at full fidelity."
          },
          {
            "token": "--radius",
            "kind": "length",
            "range": [
              12,
              28
            ],
            "unit": "px",
            "note": "The canvases’ corners: soft, never square."
          },
          {
            "token": "--radius-sm",
            "kind": "length",
            "range": [
              8,
              16
            ],
            "unit": "px",
            "note": "Fields, buttons and nested parts."
          },
          {
            "token": "--font",
            "kind": "font",
            "note": "The body face: a friendly grotesque."
          },
          {
            "token": "--font-display",
            "kind": "font",
            "note": "Titles: a heavy, rounded display face keeps the splat."
          }
        ],
        "keep": [
          "The living paint field behind the content from fidelity 40, in bright dyes far apart on the wheel.",
          "Each card’s top edge dipped in its own dye.",
          "Calm canvases frosted over the paint, so the words always read.",
          "The primary button as a blob of wet paint.",
          "Things arrive on a spring.",
          "Powder on warm paper by day, liquid paint on black by night."
        ],
        "character": [
          "Pure colour in motion behind calm surfaces.",
          "Surfaces dipped in paint, with drips.",
          "Wet paint as the primary action: a blob that never quite holds its shape.",
          "Things splat in on a spring.",
          "Soft, grainy powder by day; glossy liquid by night."
        ],
        "switches": [
          {
            "attr": "data-splash-drips",
            "name": "Drips",
            "options": [
              {
                "value": "down",
                "label": "Running down"
              },
              {
                "value": "liquid",
                "label": "Liquid on the sides"
              }
            ],
            "needs": "Running down shows from fidelity above 0; liquid on the sides needs the moving backdrop (fidelity 40 and up)."
          }
        ]
      },
      "checker": "harness/look-touch.ts",
      "facts": {
        "contrast": [
          {
            "mode": "light",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 17.72,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 16.41,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 8.21,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 5.12,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 4.95,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 4.58,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 16.98,
            "at": "fidelity 0, density 100"
          },
          {
            "mode": "dark",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 18.2,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 9.18,
            "at": "fidelity 0"
          },
          {
            "mode": "dark",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 6.05,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 6.16,
            "at": "fidelity 0"
          },
          {
            "mode": "dark",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 6.61,
            "at": "density 100"
          }
        ],
        "palette": {
          "light": {
            "bg": "#f6f2ea",
            "surface": "#fffdf8d1",
            "surface-2": "#17131c0d",
            "border": "#17131c1a",
            "text": "#17131c",
            "text-2": "#514a59",
            "text-3": "#6e6676",
            "accent": "#d4106f",
            "on-accent": "#ffffff",
            "accent-soft": "#d4106f1f",
            "ok": "#0b8a4f",
            "warn": "#a85400",
            "bad": "#d81c3f"
          },
          "dark": {
            "bg": "#08080b",
            "surface": "#121218cc",
            "surface-2": "#ffffff0d",
            "border": "#ffffff1a",
            "text": "#f6f3f9",
            "text-2": "#bab3c4",
            "text-3": "#958d9f",
            "accent": "#ff4fa8",
            "on-accent": "#17131c",
            "accent-soft": "#ff4fa82e",
            "ok": "#2bdc7c",
            "warn": "#ffc04d",
            "bad": "#ff5a72"
          }
        },
        "motion": {
          "liveliness": 100,
          "keyframes": [
            "splash-drift",
            "splash-paint-in",
            "splash-wet",
            "splash-splat",
            "splash-pop"
          ],
          "backdropMoves": true,
          "stillUnderReducedMotion": true
        },
        "cost": "not measured yet"
      }
    },
    {
      "id": "undertow",
      "name": "Undertow",
      "description": "Deep water: rounded pressure-vessel panels that fade into the dark, pill controls, thin light type, luminous aqua edges with a lilac second colour, glowing chart traces and a sonar ring for focus, with a small GPU membrane that breathes as an emblem. Suits monitoring, media and calm night-time tools. Dark first, with a pale sea-glass daylight twin.",
      "modes": [
        "dark",
        "light"
      ],
      "scheme": "dark",
      "tones": [
        "refined"
      ],
      "suits": [
        "dashboard",
        "product-presentation"
      ],
      "tags": [
        "deep water",
        "rounded",
        "pill",
        "glow",
        "dark first",
        "GPU emblem"
      ],
      "dials": {
        "liveliness": 40,
        "fidelity": 60,
        "density": 50
      },
      "backdrop": null,
      "provenance": {
        "base": null,
        "origin": null,
        "note": "Written for the library."
      },
      "stylesheet": "looks/undertow/look.css",
      "emblem": "looks/undertow/emblem.ts",
      "shared": [
        "looks/dials.css",
        "looks/dials.ts"
      ],
      "attribute": "data-look=\"undertow\"",
      "touch": {
        "knobs": [
          {
            "token": "--accent",
            "kind": "colour",
            "note": "The light in the water: primary fills, the picked pill and tab, focus, glowing traces and the emblem’s rim. Keep it luminous by night; set --on-accent with it so text on it still reads.",
            "hues": {
              "dark": {
                "from": "#79ebce",
                "fails": []
              },
              "light": {
                "from": "#0a6c64",
                "fails": []
              }
            }
          },
          {
            "token": "--on-accent",
            "kind": "colour",
            "note": "Text and icons on the accent, and the picked segment’s label.",
            "hues": {
              "dark": {
                "from": "#03141b",
                "fails": []
              },
              "light": {
                "from": "#f2fffb",
                "fails": []
              }
            }
          },
          {
            "token": "--utw-edge",
            "kind": "colour",
            "note": "The lit rim of floating things, gauge bezels and hovered controls: a see-through tint of the accent.",
            "hues": {
              "dark": {
                "from": "#79ebce6b",
                "fails": []
              },
              "light": {
                "from": "#0a6c644d",
                "fails": []
              }
            }
          },
          {
            "token": "--utw-second",
            "kind": "colour",
            "note": "The second colour (lilac by night, violet by day): the gauges’ best band and the emblem’s threads. Keep it soft and apart from the accent.",
            "hues": {
              "dark": {
                "from": "#b8a6ea",
                "fails": []
              },
              "light": {
                "from": "#6a4fb8",
                "fails": []
              }
            }
          },
          {
            "token": "--radius",
            "kind": "length",
            "range": [
              14,
              24
            ],
            "unit": "px",
            "note": "Panels, list rows and toasts: rounded vessels, never sharp."
          },
          {
            "token": "--radius-sm",
            "kind": "length",
            "range": [
              10,
              16
            ],
            "unit": "px",
            "note": "Fields and nested parts. Buttons stay pills whatever it is."
          }
        ],
        "keep": [
          "Deep blue-black water with aqua light by night, and pale sea glass as its daylight twin.",
          "Rounded vessel panels that fade from a sheen into the dark below them.",
          "Pill controls, with the primary fill glowing faintly and the glow, never the box, growing on hover.",
          "Thin, light type for titles and wide-tracked capitals for labels.",
          "A sonar ring for focus and glowing chart traces.",
          "The water behind the page: light from the upper left, darker below, faint rising rings."
        ],
        "character": [
          "An instrument from deep water: rounded pressure vessels in the dark.",
          "Luminous aqua edges and traces, with a soft lilac second colour.",
          "Pills and thin, light type.",
          "Slow, fluid motion that settles late; glows grow, boxes stay still.",
          "Focus as a sonar ring."
        ],
        "switches": []
      },
      "checker": "harness/look-touch.ts",
      "facts": {
        "contrast": [
          {
            "mode": "dark",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 14.09,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 16.25,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 8.64,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 13.03,
            "at": "density 100"
          },
          {
            "mode": "dark",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 11.18,
            "at": "default dials"
          },
          {
            "mode": "dark",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 12.9,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--text on --surface",
            "need": 4.5,
            "min": 14.52,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--text on --bg",
            "need": 4.5,
            "min": 13.07,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--text-2 on --surface",
            "need": 4.5,
            "min": 8.08,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--on-accent on --accent",
            "need": 4.5,
            "min": 6.13,
            "at": "density 100"
          },
          {
            "mode": "light",
            "pair": "--accent on --surface",
            "need": 3,
            "min": 6.01,
            "at": "default dials"
          },
          {
            "mode": "light",
            "pair": "--accent on --bg",
            "need": 3,
            "min": 5.41,
            "at": "default dials"
          }
        ],
        "palette": {
          "dark": {
            "bg": "#04151e",
            "surface": "#0a242e",
            "surface-2": "#0f2d38",
            "border": "#79ebce24",
            "text": "#def5ec",
            "text-2": "#a3c4c6",
            "text-3": "#88abb1",
            "accent": "#79ebce",
            "on-accent": "#03141b",
            "accent-soft": "#79ebce21",
            "ok": "#86e3a6",
            "warn": "#f3c66b",
            "bad": "#ff8a8f"
          },
          "light": {
            "bg": "#e3f1ef",
            "surface": "#f6fbfa",
            "surface-2": "#e7f2f0",
            "border": "#08525a29",
            "text": "#072a31",
            "text-2": "#2c5359",
            "text-3": "#476a70",
            "accent": "#0a6c64",
            "on-accent": "#f2fffb",
            "accent-soft": "#0a6c641c",
            "ok": "#17704a",
            "warn": "#8a5500",
            "bad": "#b8263f"
          }
        },
        "motion": {
          "liveliness": 40,
          "keyframes": [],
          "backdropMoves": false,
          "stillUnderReducedMotion": true
        },
        "cost": "not measured yet"
      }
    }
  ],
  "kits": [
    {
      "id": "foundations",
      "name": "Foundations",
      "purpose": "The everyday baseline under every other kit: tokens and themes, menus, dialogs, fields, tabs, tables, shortcuts and the states a view goes through. Copy these instead of writing them again, so the effort goes into what is new.",
      "builtOn": [],
      "playbooks": [
        "page-shapes",
        "placement",
        "accessibility",
        "resilient-layout",
        "motion"
      ],
      "roles": [
        "foundation",
        "system"
      ],
      "core": [
        {
          "id": "appearance-theme",
          "why": "Light, dark and high-contrast themes, text size, density and motion as CSS variables over the shared tokens; the root every look and part reads."
        },
        {
          "id": "accessible-dialog",
          "why": "Modals, sheets and awaitable confirm() and prompt() with inert background, focus and scroll handled."
        },
        {
          "id": "menu-skins",
          "why": "One accessible menu core (keys, type-ahead, long-press, stays on screen) for context and action menus."
        },
        {
          "id": "tabs-tooltips",
          "why": "Tabs, segmented controls and tooltips with the keyboard and right-to-left details right."
        },
        {
          "id": "steady-fields",
          "why": "Form fields that keep a draft apart from the store, tie messages to fields and summarise errors on submit; sliders, steppers with units and two-thumb ranges."
        },
        {
          "id": "data-table",
          "why": "A real table with virtual rows, sticky header, multi-sort and selection for any list longer than a page."
        },
        {
          "id": "loading-states",
          "why": "Idle, loading, slow, empty and error states with a grace delay, so fast loads never flash."
        },
        {
          "id": "keyboard-shortcuts",
          "why": "One registry for shortcuts with scopes, typing guards, a help sheet and rebinding."
        },
        {
          "id": "command-palette",
          "why": "Ctrl K over every command and page, fed from the same registry as the menus."
        }
      ],
      "optional": [
        {
          "id": "capability-tiers",
          "why": "Picks how much a page may draw on this device (rich, light, WebGL, still); needed as soon as any GPU part is used."
        },
        {
          "id": "date-picker",
          "why": "Dates and ranges inline, in a popover or as a phone sheet."
        },
        {
          "id": "file-drop",
          "why": "Uploads with folders, paste, type and size checks and a progress list."
        },
        {
          "id": "beside-placement",
          "why": "Puts editors and popovers beside what they edit, never over it."
        },
        {
          "id": "labelled-undo",
          "why": "Undo and redo whose buttons say what they undo."
        },
        {
          "id": "drag-reorder",
          "why": "Reordering lists, boards and grids by mouse, touch and keyboard."
        },
        {
          "id": "tree-view",
          "why": "Virtualised trees for files, outlines and categories."
        },
        {
          "id": "split-panes",
          "why": "Resizable, dockable editor layouts saved as JSON."
        },
        {
          "id": "colour-picker",
          "why": "Colour choice with OKLCH, contrast checks and an eyedropper."
        },
        {
          "id": "effects-switchboard",
          "why": "One place to turn effects, motion and sound off, remembered per user."
        },
        {
          "id": "guided-tour",
          "why": "Onboarding steps with a spotlight and coach marks."
        },
        {
          "id": "phone-app-shell",
          "why": "Installable home-screen app with an offline service worker."
        },
        {
          "id": "reach-test",
          "why": "A test that every function is two clicks or a Ctrl K command away."
        }
      ],
      "glue": [
        "Map the project’s own design tokens onto the shared names (--text, --accent, --radius…) once at the root, or copy docs/tokens.css.",
        "Feed the command palette, menus and shortcuts from one list of the app’s actions.",
        "Routing, app state and data fetching: the library has no framework opinions.",
        "The app’s navigation shell (header, sidebar, breadcrumbs) until the library has one.",
        "Words: labels, messages, plurals and translations."
      ],
      "scenario": "Under every showcase: each one starts from these parts, mapped onto its own tokens and look.",
      "gaps": [
        {
          "name": "Combobox and multi-select",
          "size": "M",
          "why": "A searchable select with chips, async options and the listbox keyboard pattern; every form with long choices needs one, and the palette and date picker are not it."
        },
        {
          "name": "Navigation shell",
          "size": "M",
          "why": "Top bar, collapsible sidebar, breadcrumbs and a phone tab bar that hold from a phone to a wide desktop; every app rebuilds it today."
        },
        {
          "name": "Toast and notification centre",
          "size": "S",
          "why": "A queued, accessible live region with actions and undo, and a history panel; micro-interactions has toasts as an effect, not as a service."
        }
      ]
    },
    {
      "id": "dashboard",
      "name": "Dashboard",
      "purpose": "Data people read and act on: charts that are honest and accessible, tables, filters by date, and one or two GPU views for what plain charts cannot show (a million records, a forecast, shares that must add up).",
      "builtOn": [
        "foundations"
      ],
      "playbooks": [
        "performance"
      ],
      "roles": [
        "foundation",
        "hero-visual",
        "system"
      ],
      "core": [
        {
          "id": "quiet-charts",
          "why": "The everyday charts as plain SVG functions: lines, columns, sparklines, waterfalls and bullets with direct labels."
        },
        {
          "id": "more-chart-types",
          "why": "Treemaps, box plots, calendars, radars and the rest, each with its numbers as a table."
        },
        {
          "id": "chart-access",
          "why": "Colour-blind-safe palettes, every chart as a table and CSV, and words for the marks."
        },
        {
          "id": "kpi-tiles",
          "why": "The row of figures that lines up: one value size, the change and whether it is good, a sparkline, one sentence each."
        },
        {
          "id": "gauges-rings",
          "why": "KPI gauges and progress rings whose needles chase their values."
        },
        {
          "id": "date-picker",
          "why": "The date range every dashboard filters by, with presets like “Last 7 days”."
        }
      ],
      "optional": [
        {
          "id": "gpu-crossfilter",
          "why": "Cross-filtered charts over up to a million records, one mark each, brushing in one compute pass."
        },
        {
          "id": "sankey-flows",
          "why": "Flows between stages with few crossings."
        },
        {
          "id": "foam-treemap",
          "why": "A treemap as soap foam whose bubble areas are exact shares: the signature view of a refined dashboard."
        },
        {
          "id": "forecast-delta",
          "why": "A million Monte Carlo futures of a plan drawn as a river delta."
        },
        {
          "id": "exact-zoom-sheet",
          "why": "Rows × days from years down to an hour, every pixel the true total."
        },
        {
          "id": "weight-glyphs",
          "why": "Type whose weight carries a value, for dense tables and labels."
        },
        {
          "id": "jelly-marks",
          "why": "Bars and calendar marks as gelatine that springs and trembles on a clash."
        },
        {
          "id": "sheet-chart-suggest",
          "why": "Paste a table or CSV and get the charts that fit its columns."
        },
        {
          "id": "streaming-spreadsheets",
          "why": "Open 64 MB+ CSV and Excel files without freezing the page."
        },
        {
          "id": "units-math",
          "why": "Numbers that keep their units through arithmetic, and goal seek."
        },
        {
          "id": "dot-globe",
          "why": "A dot globe that unfolds into a map, for regional numbers."
        },
        {
          "id": "comments-tasks",
          "why": "Comments and tasks pinned to a chart or a row."
        },
        {
          "id": "split-panes",
          "why": "Resizable panes for an analyst’s layout."
        },
        {
          "id": "day-timeline",
          "why": "A live day as lanes of spans, a line for now and a handle to look ahead: control rooms, bookings, shifts."
        },
        {
          "id": "offline-sync",
          "why": "Lists and edits that keep working with no signal and sync when back."
        }
      ],
      "glue": [
        "Adapters from the app’s API to each chart’s plain inputs, and number, date and currency formatting for the locale.",
        "One filter state (date range, segment, brush) shared by every chart and kept in the URL.",
        "The card grid: which chart goes where, with titles, units, sources and last-updated times.",
        "Refresh and polling, with loading-states around each card.",
        "Permissions: who sees which numbers."
      ],
      "scenario": "A corporate dashboard that feels calm, editorial and data-rich rather than a SaaS template: KPIs with gauges, a forecast as a river delta, shares as a foam treemap, a million transactions cross-filtered, and the table under it all.",
      "gaps": [
        {
          "name": "Dashboard card grid",
          "size": "M",
          "why": "Cards that a user drags, resizes and saves as a layout, with responsive reflow; arrange-in-place edits a page, not a saved grid."
        },
        {
          "name": "Filter bar with saved views",
          "size": "M",
          "why": "Filter chips, facets with counts and named saved views, synced to the URL."
        },
        {
          "name": "Live time-series chart",
          "size": "M",
          "why": "A canvas line chart that streams points in, pans and zooms, and downsamples (LTTB) for long ranges; quiet-charts are static SVG."
        },
        {
          "name": "Flat choropleth map",
          "size": "M",
          "why": "Regions shaded by value with a legend and a table view; the globes are for stories, not region comparisons."
        },
        {
          "name": "Aligned status table",
          "size": "S",
          "why": "Rows of items with a sign in a fixed slot, a fact per column, a quiet detail line, rowspan groups and tabular numbers, stacking into aligned blocks when narrow."
        }
      ],
      "tones": {
        "strict": {
          "drop": [
            {
              "id": "jelly-marks",
              "why": "Marks that spring and tremble are motion without meaning in a strict view."
            },
            {
              "id": "foam-treemap",
              "why": "Use the crisp treemap from more-chart-types: same shares, no living foam."
            }
          ],
          "pick": [
            {
              "id": "weight-glyphs",
              "why": "Dense tables that carry a value in the type weight, without decoration."
            }
          ]
        },
        "refined": {
          "pick": [
            {
              "id": "foam-treemap",
              "why": "One signature view per screen: shares as foam."
            }
          ]
        },
        "playful": {
          "swap": [
            {
              "from": "quiet-charts",
              "to": "jelly-marks",
              "why": "Bars as jelly that answers the hand; keep quiet-charts for sparklines and small multiples."
            }
          ],
          "pick": [
            {
              "id": "sand-charts",
              "why": "Values poured as sand into glasses."
            },
            {
              "id": "painted-chart-marks",
              "why": "Bars and lines as physical things: liquid, ferrofluid, vines."
            }
          ]
        }
      }
    },
    {
      "id": "game",
      "name": "Game",
      "purpose": "A playable 3D or 2D game in the browser: input for every device, cameras that feel right, ground and sky, things that move without an animation clip, effects, and a frame rate that holds on weak GPUs.",
      "builtOn": [
        "foundations"
      ],
      "playbooks": [
        "scenes",
        "performance"
      ],
      "roles": [
        "system",
        "interaction",
        "hero-visual",
        "foundation"
      ],
      "core": [
        {
          "id": "play-input",
          "why": "Keys, gamepad and touch, one seat each, with hint glyphs that follow the device last used."
        },
        {
          "id": "game-cameras",
          "why": "Third-person, top-down and chase cameras that pull in round walls and never clip."
        },
        {
          "id": "capability-tiers",
          "why": "Picks the quality tier for the device before the first frame."
        },
        {
          "id": "dynamic-resolution",
          "why": "Holds the frame budget by moving the render scale from the GPU’s own timings."
        },
        {
          "id": "compile-without-stalls",
          "why": "Shaders and pipelines built ahead, so nothing hitches the first time it appears."
        },
        {
          "id": "ray-grid",
          "why": "Picking, shots and line of sight that stay cheap in big scenes."
        },
        {
          "id": "walk-grid",
          "why": "Pathfinding round walls and props from one blocked(x, z) question."
        },
        {
          "id": "post-stack",
          "why": "Ambient occlusion, bloom and a grade on three’s own frame copy."
        },
        {
          "id": "audio-engine",
          "why": "Music that crossfades and loops, cues on the beat, ducking and groups."
        }
      ],
      "optional": [
        {
          "id": "minimap-compass",
          "why": "Player-up or north-up navigation, saveable exploration, a full map and compass bearings on request."
        },
        {
          "id": "heightfield-chunks",
          "why": "Open ground that streams round the player in crack-free chunks."
        },
        {
          "id": "physical-sky",
          "why": "A sky, sun and stars for any time of day. Raw WebGPU, not three: the glue shares one device with the renderer or draws the sky on a canvas behind the scene."
        },
        {
          "id": "race-car",
          "why": "A full driving controller for any racing or driving game."
        },
        {
          "id": "humanoid-rig",
          "why": "Poses any humanoid skeleton and walks it with no clips."
        },
        {
          "id": "traversal",
          "why": "Vault, climb and mantle over the world’s own geometry."
        },
        {
          "id": "breakable-world",
          "why": "Walls that take holes, buildings that fall, rubble that stays."
        },
        {
          "id": "brush-through",
          "why": "Plants and water that part round anything that moves."
        },
        {
          "id": "plants-burn",
          "why": "Plants that catch, burn and leave remains."
        },
        {
          "id": "meadow-grass",
          "why": "Hundreds of thousands of blades with wind and trampled paths."
        },
        {
          "id": "gpu-foliage",
          "why": "Trees and bushes grown on the GPU."
        },
        {
          "id": "rain-snow",
          "why": "Weather with splashes, wet surfaces and settling snow."
        },
        {
          "id": "ring-effects",
          "why": "Streaks, smoke, flame, marks and lightning that never allocate in play."
        },
        {
          "id": "gpu-particles",
          "why": "A general particle core with collisions and child emitters."
        },
        {
          "id": "agent-senses",
          "why": "NPCs that see, hear, take cover and move as a squad."
        },
        {
          "id": "crowd-bake",
          "why": "Thousands of animated figures for a few draws."
        },
        {
          "id": "vehicle-models",
          "why": "Helicopter, airboat, sprung car and grapple line as small pure models."
        },
        {
          "id": "mech-walkers",
          "why": "Legged machines that walk from code."
        },
        {
          "id": "quadruped-gait",
          "why": "Four-legged animals that walk, trot and run without clips."
        },
        {
          "id": "mesh-dents",
          "why": "Crash dents on any mesh from a small table."
        },
        {
          "id": "water-ripples",
          "why": "Ripples, wakes and caustics that follow the camera."
        },
        {
          "id": "cloud-shadows",
          "why": "Cloud shade drifting over everything the sun lights."
        },
        {
          "id": "lamp-lights",
          "why": "Hundreds of lamps for the price of eight lights."
        },
        {
          "id": "auto-instancer",
          "why": "Instancing for every plain mesh with no change to scene code."
        },
        {
          "id": "gltf-motion",
          "why": "GLB models gated, measured and loaded with their recorded motion."
        },
        {
          "id": "world-pinned-labels",
          "why": "Crisp HTML labels over the 3D world for names and markers."
        },
        {
          "id": "ui-sounds",
          "why": "Menu and HUD sounds synthesised live, no files."
        },
        {
          "id": "skin-seam",
          "why": "For 2D games: one simulation that wears any number of looks."
        },
        {
          "id": "pixel-art-layer",
          "why": "For 2D games: true pixel art from ordinary Canvas 2D calls."
        }
      ],
      "glue": [
        "The game loop and its rules: scenes, state machine, scoring, win and lose.",
        "Level data and spawning: where things are, and what each part is told about the world (heights, blocked cells, colliders).",
        "The HUD and the pause and settings menus, on the foundations (menus, dialogs, shortcuts with rebinding).",
        "Save and load, and the asset pipeline (naming, trimming and compressing models).",
        "Wiring each part’s events to sound and effects (a hit to ring-effects and a sound cue)."
      ],
      "scenario": "A playable driving playground or garden walk: a car or a walker on streamed ground under a physical sky, plants and water that give way and burn, things that break, cameras that never clip, on keys, a pad or touch.",
      "gaps": [
        {
          "name": "Game HUD kit",
          "size": "M",
          "why": "Health and ammo bars, objective markers on the screen edge, damage direction and a speedometer, all reading the shared tokens. The compass is covered by minimap-compass."
        },
        {
          "name": "Positional 3D audio",
          "size": "S",
          "why": "Sounds placed in the world (panner, distance, occlusion through ray-grid) on top of audio-engine."
        },
        {
          "name": "Settings and pause menu",
          "size": "M",
          "why": "Graphics (tier, resolution), audio levels and controls with rebinding, saved, for keys, pad and touch."
        },
        {
          "name": "Save slots",
          "size": "S",
          "why": "Versioned saves in IndexedDB with thumbnails, autosave and migration."
        },
        {
          "name": "General rigid-body physics",
          "size": "L",
          "why": "Stacks of boxes, joints and ragdolls colliding with each other; the library’s models are purpose-built and step against the ground only."
        }
      ],
      "tones": {
        "strict": {
          "drop": [
            {
              "id": "ui-sounds",
              "why": "A strict game keeps only sounds that carry game information (audio-engine cues)."
            }
          ]
        },
        "refined": {
          "pick": [
            {
              "id": "cinematic-lens",
              "why": "A grade, bloom and light shafts for a cinematic look."
            },
            {
              "id": "lit-height-fog",
              "why": "Depth and mood from low fog that glows round the lights."
            }
          ]
        },
        "playful": {
          "pick": [
            {
              "id": "comic-text",
              "why": "Sound-effect words and speech balloons that pop."
            },
            {
              "id": "fireworks",
              "why": "Celebrations with real colour chemistry."
            },
            {
              "id": "ui-sounds",
              "why": "Sound on every menu touch."
            }
          ]
        }
      }
    },
    {
      "id": "product-presentation",
      "name": "Product presentation",
      "purpose": "A cinematic page for one object: the model loaded fast and lit well, camera moves between shots that frame it beside the copy, materials that read true, and labels on its parts, on any device.",
      "builtOn": [
        "foundations"
      ],
      "playbooks": [
        "scenes",
        "performance"
      ],
      "roles": [
        "hero-visual",
        "system",
        "interaction",
        "foundation"
      ],
      "core": [
        {
          "id": "gltf-motion",
          "why": "Gates, measures and loads the product’s GLB with its recorded motion."
        },
        {
          "id": "camera-director",
          "why": "Shots as data, with a lens shift that frames the product beside the text on any screen shape."
        },
        {
          "id": "post-stack",
          "why": "Ambient occlusion, bloom and a grade that make the render read as a photo."
        },
        {
          "id": "world-pinned-labels",
          "why": "Crisp HTML labels on the product’s parts that follow it as it turns."
        },
        {
          "id": "compile-without-stalls",
          "why": "Every material compiled before the first shot, so no move hitches."
        },
        {
          "id": "capability-tiers",
          "why": "Rich, light, WebGL or a still picture by device, decided before loading."
        }
      ],
      "optional": [
        {
          "id": "vehicle-showcase",
          "why": "A staged bay with part modding and x-ray, for vehicles and anything with named parts."
        },
        {
          "id": "material-designer",
          "why": "Procedural materials as recipes kept in the repo."
        },
        {
          "id": "card-material",
          "why": "One lit surface for every finish: metal, clearcoat, fabric, foil."
        },
        {
          "id": "thin-film",
          "why": "Iridescent coatings worked out across the spectrum."
        },
        {
          "id": "cinematic-lens",
          "why": "Light shafts, bloom and a grade for the hero shots."
        },
        {
          "id": "css-locked-stage",
          "why": "3D locked to the page’s CSS pixels, so the product sits in the layout."
        },
        {
          "id": "tilted-dom-gpu",
          "why": "GPU light on DOM panels tilted in CSS 3D."
        },
        {
          "id": "read-reveals",
          "why": "Copy that reveals as the reader reaches it."
        },
        {
          "id": "slide-transitions",
          "why": "Transitions between product pictures."
        },
        {
          "id": "arrival-shockwave",
          "why": "A title moment for a launch."
        },
        {
          "id": "video-textures",
          "why": "Recorded video in the scene and the page under a decode budget."
        },
        {
          "id": "probe-lighting",
          "why": "Light bounced round a room for interiors."
        },
        {
          "id": "progressive-path-tracer",
          "why": "Path-traced stills of box-and-ellipsoid rooms under the real sun."
        },
        {
          "id": "colour-picker",
          "why": "A colour configurator with contrast checks."
        },
        {
          "id": "transform-rig",
          "why": "Pick and turn parts in an explorer view."
        },
        {
          "id": "light-sheets",
          "why": "Haze and light sheets for a stage set."
        },
        {
          "id": "liquid-glass",
          "why": "Glass panels for specs and prices over a live backdrop."
        }
      ],
      "glue": [
        "The story: which scroll position or step shows which shot, label and paragraph.",
        "Preparing the model: named nodes for parts, trimmed and compressed, and a poster still for the lowest tier.",
        "The copy, prices and call to action laid out beside the framed product.",
        "Configurator state (colour, trim) mapped to materials and to the URL."
      ],
      "scenario": "A cinematic page for one object: it arrives in a lit studio, the camera moves through framed shots as the copy scrolls, labels sit on its parts, a material swatch changes its finish live, and a phone gets a light tier or a still.",
      "gaps": [
        {
          "name": "Scroll-driven staging",
          "size": "M",
          "why": "Scroll position (or step) to camera shots, label visibility and reveals, with snap points, keyboard steps and a reduced-motion path; the story every presentation page needs."
        },
        {
          "name": "Exploded view",
          "size": "M",
          "why": "Parts move apart along their own axes on a slider, with labels and a return to assembled."
        },
        {
          "name": "AR hand-off",
          "size": "M",
          "why": "Open the same model in the phone’s AR viewer (USDZ, Scene Viewer) with the right scale and a fallback."
        },
        {
          "name": "Photo turntable",
          "size": "S",
          "why": "A 360° spin from a photo sequence with drag, inertia and zoom, for products without a 3D model."
        }
      ],
      "tones": {
        "strict": {
          "drop": [
            {
              "id": "cinematic-lens",
              "why": "No lens drama: true colours and a neutral studio."
            }
          ]
        },
        "playful": {
          "pick": [
            {
              "id": "card-springs",
              "why": "Spec cards that wobble and flutter when touched."
            },
            {
              "id": "arrival-shockwave",
              "why": "A launch moment at lightspeed."
            }
          ]
        }
      }
    },
    {
      "id": "shop",
      "name": "Shop",
      "purpose": "A designed online shop: product cards that feel like things, quick feedback when something goes in the cart, lists that know the customer, an installable app on the phone, and checkout forms that never fight the user.",
      "builtOn": [
        "foundations"
      ],
      "playbooks": [],
      "roles": [
        "foundation",
        "interaction",
        "hero-visual",
        "system"
      ],
      "core": [
        {
          "id": "card-springs",
          "why": "Product cards on damped springs: they lean, lift and squash under the hand."
        },
        {
          "id": "micro-interactions",
          "why": "Add-to-cart feedback, toasts, rolling numbers for totals and magnetic buttons."
        },
        {
          "id": "swipe-actions",
          "why": "Swipe a cart or wishlist row to remove or save it, as on a phone."
        },
        {
          "id": "phone-app-shell",
          "why": "Installable on the home screen, pages kept for offline."
        }
      ],
      "optional": [
        {
          "id": "steady-fields",
          "why": "The price range with a histogram of what it holds, quantity steppers, and checkout fields that never fight the user."
        },
        {
          "id": "liquid-glass",
          "why": "Glass panels for the hero or the cart summary over a live backdrop."
        },
        {
          "id": "card-material",
          "why": "Foil, clearcoat and fabric finishes for product and gift cards."
        },
        {
          "id": "colour-picker",
          "why": "Custom colours for made-to-order products."
        },
        {
          "id": "list-smarts",
          "why": "Shopping lists that sort the way the customer walks the shop."
        },
        {
          "id": "offline-sync",
          "why": "Shared lists and baskets that keep working with no signal."
        },
        {
          "id": "hold-to-confirm",
          "why": "A safe button for actions that cost something."
        },
        {
          "id": "throw-to-commit",
          "why": "Throw a card into the cart or the bin."
        },
        {
          "id": "impact-plates",
          "why": "The whole page dips and rings when something lands in the cart."
        },
        {
          "id": "ui-sounds",
          "why": "Taps and a success chime, made live."
        },
        {
          "id": "units-math",
          "why": "Prices per kilo or per metre that carry their units."
        },
        {
          "id": "file-io",
          "why": "Receipts and order summaries as PDF with no library."
        },
        {
          "id": "guided-tour",
          "why": "First-visit tips on the shop’s own controls."
        },
        {
          "id": "vehicle-showcase",
          "why": "A staged 3D bay for products with named parts."
        },
        {
          "id": "gltf-motion",
          "why": "A 3D product view loaded under budgets."
        },
        {
          "id": "drag-reorder",
          "why": "Reordering wishlists and bundles."
        }
      ],
      "glue": [
        "The product model: variants, prices, stock and tax display, from the shop’s backend.",
        "Cart state, persisted and synced across tabs, with totals recomputed in one place.",
        "Payment through the provider’s own hosted fields or page; never hand-built card fields.",
        "Search and category pages (the command palette covers quick search).",
        "Order emails, accounts and SEO pages on the server."
      ],
      "scenario": "A designed online shop that feels tactile, crafted and fast: cards that lean under the hand, a cart that answers with a ring and a rolling total, rows that swipe away on a phone, and a checkout with no surprises.",
      "gaps": [
        {
          "name": "Product gallery with zoom",
          "size": "M",
          "why": "Thumbnails, swipe on touch, pinch and hover zoom at full resolution, keyboard and a lightbox."
        },
        {
          "name": "Cart drawer",
          "size": "S",
          "why": "A side sheet with line items, quantity steppers, totals, undo on remove and a focus-safe open and close (on accessible-dialog)."
        },
        {
          "name": "Filters and facets",
          "size": "M",
          "why": "Facets with counts, price range, chips for active filters, a phone sheet and URL state."
        },
        {
          "name": "Checkout form",
          "size": "M",
          "why": "Address with lookup, delivery choice, the payment provider’s hosted element, order summary and inline errors (on steady-fields)."
        },
        {
          "name": "Variant picker",
          "size": "S",
          "why": "Swatches and sizes with stock state, unavailable combinations explained, and the price updating."
        },
        {
          "name": "Ratings and reviews",
          "size": "S",
          "why": "Star summary with distribution, filters and accessible review lists."
        }
      ],
      "tones": {
        "strict": {
          "drop": [
            {
              "id": "card-springs",
              "why": "A plain, fast product grid; no wobble."
            }
          ]
        },
        "refined": {
          "pick": [
            {
              "id": "liquid-glass",
              "why": "One signature glass panel for the hero or cart summary."
            },
            {
              "id": "card-material",
              "why": "Real finishes on gift cards and swatches."
            }
          ]
        },
        "playful": {
          "pick": [
            {
              "id": "throw-to-commit",
              "why": "Throw products into the cart."
            },
            {
              "id": "impact-plates",
              "why": "The page rings when something lands."
            },
            {
              "id": "ui-sounds",
              "why": "Sound on taps and on a completed order."
            },
            {
              "id": "comic-text",
              "why": "Sale stickers and sound-effect words."
            }
          ]
        }
      }
    }
  ],
  "playbooks": [
    {
      "id": "page-shapes",
      "title": "Page shapes",
      "group": "interface",
      "rules": [
        {
          "section": "Before you start",
          "text": "The concept is written before a shape is picked: what the page is, for whom, and how it should feel",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "The build notes name the shape: one of these, changed where the concept asks, or one composed with the five steps at the end",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "The reader's one job and the action at the end of the reading path are each written in a sentence",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "The first screen is planned at 1280×720 (about 600 pixels of height under the browser's bars) and at 390×844",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Where the person asked for something the shape advises against, their wish is built and the notes say which rule it bent",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Nothing widens the page at 320 pixels wide and every target is at least 24 pixels: WCAG AA's reflow and target size, without which people who zoom or use a small phone can't use the page at all",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Nothing moves on its own for more than five seconds without a way to pause it, and reduced motion is honoured: WCAG AA's pause rule, and motion can make people ill",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "App workspace",
          "text": "No hero, no marketing header",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "App workspace",
          "text": "Only the work scrolls",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "App workspace",
          "text": "A returning user does the commonest task from a cold load in two clicks or one Ctrl K command",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "App workspace",
          "text": "At 1280×720 every tool is on screen without scrolling the page, and the work keeps at least half the width",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Dashboard",
          "text": "No hero and no welcome copy",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Dashboard",
          "text": "No wall of equal cards",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Dashboard",
          "text": "Every chart also as a table or words",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Dashboard",
          "text": "Someone who has never seen the board says from its first screen, at 1280×720, whether things are fine, within five seconds",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Dashboard",
          "text": "Each figure in the top row leads to the chart or rows behind it in one click",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Product reveal",
          "text": "The scroll stays the reader's",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Product reveal",
          "text": "The words are text in the page",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Product reveal",
          "text": "No datasheet on the first screen",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Product reveal",
          "text": "With WebGL missing or the model slow to load, the poster still and the copy tell the whole story, and the call is reached",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Product reveal",
          "text": "Scrolled at an ordinary pace, each scene holds long enough to read its line, and the 3D keeps its frame budget on the target laptop (Performance budgets)",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Service landing",
          "text": "No app chrome before sign-up",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Service landing",
          "text": "No splash or intro",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Service landing",
          "text": "Prices on the page",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Service landing",
          "text": "Shown the first screen for five seconds, a stranger can say what the service does, for whom, and what the button will do",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Service landing",
          "text": "From any scroll position the call is at most one screen away",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Story or long read",
          "text": "No cards, no grid, no rail",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Story or long read",
          "text": "Every word is in the page from the start",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Story or long read",
          "text": "Lines stay short on wide screens",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Story or long read",
          "text": "Read on a phone from top to bottom, nothing makes the reader stop to work out the page: no sideways scroll, no scene to wait for",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Story or long read",
          "text": "The reader can always see how far they are and jump to any chapter",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Personal homepage",
          "text": "Show the work, not a dashboard of skills",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Personal homepage",
          "text": "No intro before the name",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Personal homepage",
          "text": "No service-landing sections",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Personal homepage",
          "text": "In ten seconds a stranger can say who this is, what they make, and how to reach them",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Personal homepage",
          "text": "The person it is about reads it and says it sounds like them",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Event",
          "text": "No date without its weekday, year and time zone",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Event",
          "text": "No splash before the facts",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Event",
          "text": "The page never stays in \"before\"",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Event",
          "text": "From the first screen, at 1280×720 and on a phone, someone can say what, when (weekday, date, time) and where, and press the call",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Event",
          "text": "With the clock set to the day itself and then a week after, the page shows now and next, then the after page, with no stale call",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Shop",
          "text": "No reveal scenes on product pages",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Shop",
          "text": "No surprise at the end",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Shop",
          "text": "The checkout works for everyone",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Shop",
          "text": "On a phone, with one thumb, a product is found, a variant chosen and the order placed, and the keyboard never covers the button",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Shop",
          "text": "The basket's count and total change the moment something is added",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Game",
          "text": "No page around the game",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Game",
          "text": "Nothing in the centre but play",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Game",
          "text": "Nothing flashes more than three times a second",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Game",
          "text": "From a cold load, play starts within two presses",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Game",
          "text": "Mid-play, Escape, Start or the corner button pauses the world at once, and every menu works by keyboard, gamepad and touch",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Compose a shape",
          "text": "Borrow by field, not by page",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Compose a shape",
          "text": "Keep what holds for every shape",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Compose a shape",
          "text": "A composed shape that works twice is a candidate for this playbook",
          "strength": "idea",
          "kind": "rule"
        }
      ]
    },
    {
      "id": "placement",
      "title": "Placement and layout",
      "group": "interface",
      "rules": [
        {
          "section": "Before you start",
          "text": "Every function is listed, with its one home and the exact control that reaches it",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Everything is within two clicks of the main view, or in the command palette",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Each screen and each card has one primary action, at the end of the reading path",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "A menu or panel holds one kind of thing, scoped to what it acts on",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Editors open beside what they edit, never on top of it, and floating bars cover no other content where a clear side exists",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Things that grow take only free room; otherwise they keep their size and scroll or summarise",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Every per-item editor has a board-wide index (a table of every input, and a Find that knows the names) once there can be hundreds of items",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Inspectors and settings panels are rows: the name on the left with its unit, the control on the right, every control ending on one edge",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Settings set once are folded away, shut by default, and the fold says what they are",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Every live figure says whether it is live, paused or ended, and each quantity is written one way across the screen (rounding included: a clock truncates)",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "In a row of figures every value is the same size, on one line, under a label of the same style; extras sit on a reserved detail line under their value",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Status and alert text is a short headline and label/value facts, no line over about 60 characters; a wide box gets columns, not longer lines",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Rows that say several things about an item are a table (a column per fact, signs in a fixed slot, details on a quiet second line, numbers tabular), stacking into aligned blocks when narrow; never a s…",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Something new that lands off screen is brought into view by the smallest move, never by recentring",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "The work owns the middle of the screen; the chrome keeps to the edges",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Only the content scrolls. The bars stay put and the page never scrolls sideways",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "A control offers only the choices that apply to what is selected now",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "What you selected is what an action changes; the selection never moves by itself",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "A toggle names its state or offers both sides, never an action that is already done",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Checked at 1280×720, on a phone with the keyboard open, and at the largest screen you support",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Where things go",
          "text": "One column of names, one of controls,",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Where things go",
          "text": "One setting a row, its name stating the unit",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Where things go",
          "text": "What the numbers come to, under them, live",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Data displays",
          "text": "A live figure says its state in words",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Data displays",
          "text": "One quantity, one way of writing it, across the screen",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Data displays",
          "text": "A row of figures lines up",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Data displays",
          "text": "Several facts per row: a table, not a sentence",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Data displays",
          "text": "Status is a headline and short facts, not a sentence",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Data displays",
          "text": "A readout never moves the layout",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Data displays",
          "text": "Working out readouts is not running",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Group by what it acts on",
          "text": "The whole app",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Group by what it acts on",
          "text": "This document",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Group by what it acts on",
          "text": "The selection",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Group by what it acts on",
          "text": "One item's own parts",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Choices that fit the selection",
          "text": "Offer only what applies",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Choices that fit the selection",
          "text": "The selection is what changes",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Choices that fit the selection",
          "text": "A toggle says its state",
          "strength": "default",
          "kind": "checklist"
        }
      ]
    },
    {
      "id": "layout-studio",
      "title": "Layout studio",
      "group": "interface",
      "rules": [
        {
          "section": "Before you start",
          "text": "You can say in one sentence what the screen is for, and name its one primary action",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "You have listed the blocks it needs, and nothing more",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Each block has a place on every screen size, or is hidden there on purpose with another way to reach it",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Every check passes, or each one left is a decision you can explain",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Each block has a line of notes: what goes in it and how it behaves",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "The agent gets the real labels and data with the prompt, not placeholder text",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "What the agent builds is checked against the sketch at each size before it is filled in",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "A \"To check\" list tied to its place",
          "text": "Computed, never stored",
          "strength": "idea",
          "kind": "rule"
        },
        {
          "section": "A \"To check\" list tied to its place",
          "text": "Shown where it lives",
          "strength": "idea",
          "kind": "rule"
        },
        {
          "section": "A \"To check\" list tied to its place",
          "text": "One count in the top bar",
          "strength": "idea",
          "kind": "rule"
        },
        {
          "section": "A \"To check\" list tied to its place",
          "text": "Grouped as things to fix",
          "strength": "idea",
          "kind": "rule"
        },
        {
          "section": "A \"To check\" list tied to its place",
          "text": "A click goes there",
          "strength": "idea",
          "kind": "rule"
        },
        {
          "section": "A \"To check\" list tied to its place",
          "text": "An empty state that says what was checked",
          "strength": "idea",
          "kind": "rule"
        }
      ]
    },
    {
      "id": "performance",
      "title": "Performance budgets",
      "group": "interface",
      "rules": [
        {
          "section": "Before you start",
          "text": "The target is written down: a frame rate, a resolution, a pixel ratio and the device",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "The frame is split into shares, with some left spare for the browser",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "The worst frames have a budget too, not only the average",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Work that can wait shares one allowance a frame, spent in order of what matters most",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Each quality tier has its own budget in counts (particles, lights, cards), and the device picks the tier",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Nothing draws while nothing changes",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Every measurement names what it was taken on",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "A missed budget is fixed or argued about, never quietly raised to match",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Spend nothing when nothing changes",
          "text": "Render on demand",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Spend nothing when nothing changes",
          "text": "Let ambient motion rest",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Spend nothing when nothing changes",
          "text": "Never compile while drawing",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Spend nothing when nothing changes",
          "text": "Branch around procedural work that contributes nothing",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Spend nothing when nothing changes",
          "text": "Keep counts steady",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Spend nothing when nothing changes",
          "text": "Many GPU widgets share one device and one submit",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Spend nothing when nothing changes",
          "text": "Walk the matrices once a frame",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Spend nothing when nothing changes",
          "text": "One draw call for identical parts",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Spend nothing when nothing changes",
          "text": "A store's snapshot stays the same object until it changes",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Time on the frame clock, read layout once",
          "text": "Wait on frames, not timers",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Time on the frame clock, read layout once",
          "text": "Keep timers for what must finish",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Time on the frame clock, read layout once",
          "text": "Read layout in one batch, after the DOM has settled",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Time on the frame clock, read layout once",
          "text": "Skip the expensive part when nothing moved",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Measure honestly",
          "text": "Show the part in use, measure it alone",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Measure honestly",
          "text": "Name the setup",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Measure honestly",
          "text": "Compare only within one sitting",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Measure honestly",
          "text": "Time the GPU on the GPU",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Measure honestly",
          "text": "Counts aren't milliseconds",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Measure honestly",
          "text": "Measure on a quiet machine,",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Measure honestly",
          "text": "Throw away a noisy measurement",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Measure honestly",
          "text": "Draw a measured frame exactly as a real one",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "A gate for each scenario",
          "text": "A p95, a worst frame and a hitch count for each scenario",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "A gate for each scenario",
          "text": "Check the machine as well as the app",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "A gate for each scenario",
          "text": "A/B by environment variable",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "A gate for each scenario",
          "text": "Compare with the last run",
          "strength": "default",
          "kind": "rule"
        }
      ]
    },
    {
      "id": "motion",
      "title": "Motion and feel",
      "group": "interface",
      "rules": [
        {
          "section": "Before you start",
          "text": "Every animation says something: where a thing came from, where it went, or that an action took",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Durations and curves come from a few named tokens, not from each component",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Only transform and opacity animate, unless something else is worth what it costs",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Changes animate. A first layout, a resize and a restored state appear at once",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Motion stepped every frame is scaled to the frame's length, so it feels the same at 60 and 144 Hz",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Every animation can be interrupted, and input never waits for one to finish",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Nothing moves between interactions unless it means something, and ambient motion rests",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Reduced motion swaps movement for a fade or an instant change, and keeps every piece of information. Some people get dizzy or sick from motion, and they asked for less",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Curves for what is happening",
          "text": "Ease out",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Curves for what is happening",
          "text": "Ease in",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Curves for what is happening",
          "text": "Ease in and out",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Curves for what is happening",
          "text": "A spring",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Curves for what is happening",
          "text": "Linear",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "One speed setting reaches all of it",
          "text": "CSS animations and transitions",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "One speed setting reaches all of it",
          "text": "Motion made in script",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "One speed setting reaches all of it",
          "text": "Never both",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Cheap to run",
          "text": "Animate transform and opacity",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Cheap to run",
          "text": "Use the separate scale, translate and rotate properties",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Cheap to run",
          "text": "Let animations end by themselves",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Cheap to run",
          "text": "No blur or big shadows in motion",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Cheap to run",
          "text": "Text doesn't stay soft where the eye can read it",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Never in the way",
          "text": "Input never waits",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Never in the way",
          "text": "Start from where it is",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Never in the way",
          "text": "A tap is not a gesture",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Reduced motion",
          "text": "Motion follows reduced motion while the page is open, not only from the next load. Someone who turns it on feeling sick can't wait for a reload",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Reduced motion",
          "text": "The module takes reduced motion as an option; the app (or the harness) decides where it comes from",
          "strength": "default",
          "kind": "checklist"
        }
      ]
    },
    {
      "id": "accessibility",
      "title": "Accessibility baseline",
      "group": "interface",
      "rules": [
        {
          "section": "Before you start",
          "text": "Everything works with the keyboard alone, in reading order, with a focus ring you can see: one ring per control, never a doubled frame. It is the only way in for someone who can't use a mouse",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Text has 4.5:1 contrast against its background; large text, control edges and icons have 3:1. Below that, someone with low vision can't read it",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Nothing is said by colour alone: every status also has a shape or a word, on a canvas too, where it is drawn and also said in a live region. One man in twelve can't tell red from green",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Every control has a name a screen reader can say, and its state (pressed, open, current) is exposed, because a screen reader has nothing else to go on",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Changes that matter are announced once, since a screen-reader user can't see them arrive; constant chatter isn't announced at all",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Every chart and drawing has its facts as a table or as text too, or a screen reader gets none of them",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "The page works at 200% zoom and 320 pixels wide, and every target is at least 24 pixels, so people who zoom or whose hands shake can still use it",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Where the pointer is a finger, targets are 44 pixels",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Motion follows the reduced-motion setting, as Motion and feel describes. Motion on screen makes some people sick",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Keyboard first",
          "text": "Tab follows the reading order",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Keyboard first",
          "text": "Focus is always visible",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Keyboard first",
          "text": "One ring per control",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Keyboard first",
          "text": "A ring that shows whole",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Keyboard first",
          "text": "The app's own focus rule is the weakest",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Keyboard first",
          "text": "A group is one Tab stop",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Keyboard first",
          "text": "Esc closes the topmost thing,",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Keyboard first",
          "text": "A way past the chrome",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Names, roles and states",
          "text": "Use the real element first",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Names, roles and states",
          "text": "Every icon button has a name",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Names, roles and states",
          "text": "Say the state",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Names, roles and states",
          "text": "Signs never set where the text starts",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Names, roles and states",
          "text": "A toggle keeps its label",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Names, roles and states",
          "text": "Describe what a drawing shows",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Charts and pictures have words",
          "text": "Every chart is also a table,",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Charts and pictures have words",
          "text": "A graph you can travel",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Charts and pictures have words",
          "text": "Text stays text",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Charts and pictures have words",
          "text": "Pictures have alternatives",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Zoom, reflow and targets",
          "text": "At 200% zoom, or 320 pixels wide, everything still works",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Zoom, reflow and targets",
          "text": "Sizes in rem",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Zoom, reflow and targets",
          "text": "Targets are at least 24 pixels",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Zoom, reflow and targets",
          "text": "44 pixels where the pointer is a finger",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Codes people type",
          "text": "Compare without case",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Codes people type",
          "text": "Tell the keyboard as well",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Codes people type",
          "text": "Or pick codes that can't be mistyped",
          "strength": "idea",
          "kind": "rule"
        },
        {
          "section": "Check it",
          "text": "Contrast and palettes",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Check it",
          "text": "Roles, names and labels",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Check it",
          "text": "Keyboard",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Check it",
          "text": "Screen reader",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Check it",
          "text": "Zoom",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Check it",
          "text": "Settings",
          "strength": "default",
          "kind": "rule"
        }
      ]
    },
    {
      "id": "resilient-layout",
      "title": "Layouts that never break",
      "group": "interface",
      "rules": [
        {
          "section": "Before you start",
          "text": "Every piece of text can be twice as long as the sample, or 40% longer once translated, and still fit",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "No single word or link can widen the page",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Grid and flex children can shrink: minmax(0, 1fr) and min-width: 0",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Heights grow with their content: min-height, never a fixed height, on anything holding text",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Every list and panel has an empty, a loading and an error state, and works with one item and with a thousand",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Numbers use tabular figures and have room for their longest value",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "A control that shows only in some states (back to now, clear filters, undo, try again) keeps its room: visibility: hidden or a reserved slot, not hidden; toggling the state moves no box outside it, b…",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "A table that updates while it is read has fixed columns sized for its longest content (table-layout: fixed, a <colgroup>) and rows that keep their height; stepping it through its states moves no colu…",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Text that changes while the screen is in use (readouts, hover hints, status lines) keeps its box: the room of its longest message is reserved, so hovering or focusing never resizes anything. A box th…",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Pictures keep their shape and have a fallback when they are missing",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "It works right to left, and with the reader's text at 200%",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "A full-screen app root clips with overflow: clip, so a caret or focus off its edge can't scroll it",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "A box that scrolls on one axis has room inside it for focus rings (padding) and for anything that overhangs its track (end margins of half the thumb plus the ring): it clips on both axes. A cut ring …",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "A box that scrolls or clips (overflow other than visible) and holds panels pads them by var(--shadow-reach), so their shadows fade out inside it. A shadow cut at the box's edge draws a hard dark rect…",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Every part whose stylesheet sets display still hides with the hidden attribute: the base stylesheet says [hidden] { display: none } for it, written to win (.root:where([hidden]), .root :where([hidden…",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "The rules that keep it whole",
          "text": "minmax(0, 1fr), not 1fr",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "The rules that keep it whole",
          "text": "overflow-wrap: anywhere",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "The rules that keep it whole",
          "text": "min-height, not height",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "The rules that keep it whole",
          "text": "flex-wrap: wrap",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "The rules that keep it whole",
          "text": "Logical properties",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "The rules that keep it whole",
          "text": "A container query",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "The rules that keep it whole",
          "text": "Sizes in rem and em",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "The rules that keep it whole",
          "text": "hidden loses to your own display",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "The rules that keep it whole",
          "text": "overflow: clip, not hidden, on a fixed full-screen root",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "The rules that keep it whole",
          "text": "A box that scrolls on one axis clips on both",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "The rules that keep it whole",
          "text": "A box that scrolls cuts its panels' shadows square",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Cut on purpose",
          "text": "Cut at a sensible point, and keep the whole",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Cut on purpose",
          "text": "A shorter label beats a cut one",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Cut on purpose",
          "text": "Never cut a number",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Sizes that bend, within limits",
          "text": "Fluid between two limits",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Sizes that bend, within limits",
          "text": "Reading lines of 60 to 80 characters",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Sizes that bend, within limits",
          "text": "Popovers sized to the screen,",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Sizes that bend, within limits",
          "text": "Floating things stay on screen",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Every state has a design",
          "text": "Empty",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Every state has a design",
          "text": "Loading",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Every state has a design",
          "text": "Error",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Every state has a design",
          "text": "Partial",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "A restyle moves nothing",
          "text": "Draw states with paint",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "A restyle moves nothing",
          "text": "Reserve what a state needs",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "A restyle moves nothing",
          "text": "A theme changes colours, never sizes",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "A restyle moves nothing",
          "text": "Danger keeps its colour",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "A restyle moves nothing",
          "text": "Check it by measuring",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Live text never moves the layout",
          "text": "Reserve the room of the longest message",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Live text never moves the layout",
          "text": "Or give it a fixed number of lines,",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Live text never moves the layout",
          "text": "Cap a clamped box at its lines",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Live text never moves the layout",
          "text": "Figures change in place",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Live text never moves the layout",
          "text": "A control that comes and goes keeps its room",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Live text never moves the layout",
          "text": "A table that updates while it is read has fixed columns",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Live text never moves the layout",
          "text": "A resting hint is a message too",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Live text never moves the layout",
          "text": "Check it by measuring,",
          "strength": "default",
          "kind": "rule"
        }
      ]
    },
    {
      "id": "ingest",
      "title": "Ingest that never double-counts",
      "group": "pipelines",
      "rules": [
        {
          "section": "Before you start",
          "text": "Every file is known by a hash of its bytes, never by its name or path",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Every record has a key of its own (a receipt number, an order id), checked against everything already written before anything is written",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "When the duplicate check can’t run, nothing is written: the item waits and is tried again",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "The job keeps its own record of every row it wrote, and checks that as well as the destination",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Files are found by polling, and taken only once they have been non-empty and unchanged for 3 seconds",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "A folder someone chose that has gone missing is reported, never created again empty",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "One worker writes, and a file that fails is marked as failed while the worker carries on",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Every decision is appended to a log a person can read without the app, and nothing ever rewrites it",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Two machines that share a synced folder each append only to their own file in it",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Whatever needs a decision goes to a review queue with its reason, and is never guessed",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "One writer, and no file can stop it",
          "text": "One worker writes",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "One writer, and no file can stop it",
          "text": "One bad file can’t kill it",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "One writer, and no file can stop it",
          "text": "A locked destination is a wait, not a failure",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Two PCs, one synced folder",
          "text": "One file per PC",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Two PCs, one synced folder",
          "text": "The latest line wins,",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Two PCs, one synced folder",
          "text": "One PC writes the destination",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Two PCs, one synced folder",
          "text": "Offline is a backlog, not a loss",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Two PCs, one synced folder",
          "text": "Unreadable is “can’t tell”",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Try to break it",
          "text": "Drop the same file twice under two names: one row",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Try to break it",
          "text": "Drop a copy with one value changed: a conflict, with that value marked",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Try to break it",
          "text": "Rename or unplug the destination folder, then drop a file: it waits, and goes through when the folder is back",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Try to break it",
          "text": "Open the destination in its app, then drop a file: it waits, and is written when the file is closed; a row lost here is someone’s work lost",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Try to break it",
          "text": "Copy a large file slowly into the inbox: it is taken once, after it has finished",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Try to break it",
          "text": "Drop a broken file among good ones: it is marked as failed, and the others are written",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Try to break it",
          "text": "Delete a written row by hand and drop its file again: it is skipped, and Reprocess writes it",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Try to break it",
          "text": "Take both PCs offline, drop files on each, bring them back: every file once, and no conflict copies in the shared folder",
          "strength": "default",
          "kind": "checklist"
        }
      ]
    },
    {
      "id": "blender-assets",
      "title": "Sculpted, not assembled: 3D assets from a Blender script",
      "group": "pipelines",
      "rules": [
        {
          "section": "Before you start",
          "text": "One script builds every tier, the editable .blend files, the glTF files and a report. Nothing is fixed by hand afterwards",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "The main form is a few overlapping closed volumes, built densely whatever the tier",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "The volumes are unioned, voxel-remeshed, smoothed, and only then decimated to each tier's budget",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "A smoother, dense copy of the surface is kept, and the decimated mesh takes its normals from it",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Crisp lines (openings, vents, shut lines, lamps) are cut after the smoothing, never before",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Review renders come from fixed, named views, have a quick mode, and resume where an interrupted run stopped",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "A ray sweep over the sides and top finds nothing inside showing through the shell",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Every node has a unique name with no .001 on it, and a check fails the build if one hasn't",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Crisp lines come last",
          "text": "Glass and lenses first",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Crisp lines come last",
          "text": "Panels from the same solid",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Crisp lines come last",
          "text": "Pockets follow the skin",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Crisp lines come last",
          "text": "Mark what a cut made",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Crisp lines come last",
          "text": "Clean up after long chains of booleans",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Crisp lines come last",
          "text": "Skins stand off",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Review renders you can trust",
          "text": "A quick mode",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Review renders you can trust",
          "text": "Resumable runs",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Names the runtime can trust",
          "text": "Name in code, uniquely",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Names the runtime can trust",
          "text": "Fail the build on a duplicate,",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Names the runtime can trust",
          "text": "Check the exported file too",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Names the runtime can trust",
          "text": "Alternatives under their own nodes",
          "strength": "default",
          "kind": "rule"
        }
      ]
    },
    {
      "id": "desktop-companions",
      "title": "Office and desktop companions",
      "group": "pipelines",
      "rules": [
        {
          "section": "Before you start",
          "text": "A slide page is one self-contained file: scripts, styles, fonts and pictures inline, nothing fetched",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Every slide page draws something good with WebGPU, with WebGL2 and with neither, and has a still mode for its fallback picture",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Settings a slide needs are baked into its page at build time, never shared through storage",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Each slide page paints its background colour from its first byte, the same colour as the slide behind it",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Each slide page hands the keyboard back to PowerPoint after a click",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "The desktop tool installs per user, with no admin rights, and keeps its data outside the program folder",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Starting the tool a second time shows the running one; it never starts a second server",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Closing the window leaves the tool working in the tray, and Quit is in the tray menu",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Start with Windows is one registry value, written the same way by the installer and the app, and removed on uninstall",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "A workbook is written to a copy and renamed over the old one, never saved in place, so a crash or a full disk never leaves people with half a workbook",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "A workbook that is open in Excel makes the row wait; it is never an error that loses the row, because the row is someone's work",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "A new row takes its formatting from the data row above it",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Slides: the browser inside",
          "text": "Scale, never lay out in pixels",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Slides: the browser inside",
          "text": "Three tiers, never a blank slide",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Slides: the browser inside",
          "text": "A ?snapshot mode",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Slides: the browser inside",
          "text": "The page is never told it is being left",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Slides: the browser inside",
          "text": "Run the deck through once on the presenting PC",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Slides: no network, sealed storage",
          "text": "Settings chosen for the whole deck (a look, a motion preset) are baked into every page when the deck is built. A settings slide that writes to storage would reach only itself",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Slides: no network, sealed storage",
          "text": "Slides can't warm each other up. Each page waits for its own fonts and first GPU frame (capped, so a slow GPU can't hold it back) before its entrance plays",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Slides: the white first frame",
          "text": "The page",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Slides: the white first frame",
          "text": "The picture",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Desktop: build it, then install it per user",
          "text": "Data lives apart from the program",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Desktop: build it, then install it per user",
          "text": "A windowed program has no console",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Desktop: build it, then install it per user",
          "text": "List what PyInstaller can't see",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Desktop: build it, then install it per user",
          "text": "Stop the running copy before an update",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Desktop: build it, then install it per user",
          "text": "Unsigned means a warning",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Desktop: the window is Edge in app mode",
          "text": "Find Edge",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Desktop: the window is Edge in app mode",
          "text": "A profile of its own",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Desktop: the window is Edge in app mode",
          "text": "The server listens on 127.0.0.1 only,",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "Desktop: the window is Edge in app mode",
          "text": "To bring the window back,",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Desktop: the tray",
          "text": "The menu",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Desktop: the tray",
          "text": "The tooltip",
          "strength": "idea",
          "kind": "rule"
        },
        {
          "section": "Desktop: the tray",
          "text": "The tray must not die",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Workbooks: Excel's lock file",
          "text": "Skip it",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Workbooks: Excel's lock file",
          "text": "Show it",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Workbooks: Excel's lock file",
          "text": "Let the rename decide",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Workbooks: styles from the row above",
          "text": "Find the last row by its values,",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Workbooks: styles from the row above",
          "text": "Formulas follow their row",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Try to break it",
          "text": "Present the probe slide on the presenting PC, and copy its report before building anything else",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Try to break it",
          "text": "Unplug the network and show every live slide: nothing is missing",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Try to break it",
          "text": "Force each slide to WebGL2 and to no GPU: each still makes its point",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Try to break it",
          "text": "Click into a live slide, then use the clicker: the talk moves on",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Try to break it",
          "text": "Open the deck on a PC whose PowerPoint can't run content blocks: the fallback pictures read well",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Try to break it",
          "text": "Start the desktop tool twice: one window, one server",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Try to break it",
          "text": "Close its window, drop a file in the inbox: it is processed, and the tray says so",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Try to break it",
          "text": "Log off and on with Start with Windows ticked: it is in the tray, with no window",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Try to break it",
          "text": "Uninstall, then check the Run key and the data folder: the value is gone, the data is kept, because people's data must outlive the program",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Try to break it",
          "text": "Open the workbook in Excel, then drop a file: the row waits, and is written when Excel closes it; a row lost here is someone's work lost",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Try to break it",
          "text": "End the tool while it writes (Task Manager): the workbook still opens, and holds the row or not, never half, since a half-written workbook can take every row with it",
          "strength": "always",
          "kind": "checklist"
        }
      ]
    },
    {
      "id": "many-agents",
      "title": "Many agents, one codebase",
      "group": "together",
      "rules": [
        {
          "section": "Before you start",
          "text": "The work splits into pieces that each live in their own folder, or in files no other piece touches",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "No piece has to edit a shared list (an index, a route table, a registry): the code discovers pieces from their folders instead",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "The contract is fixed: the types, the API between the pieces, the folder layout and what \"done\" means",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Every shared file has one owner, the coordinating session, and agents are told not to edit it",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "One brief, kept as a file, says what to read, the rules, how to check the work and how to report",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "A small first batch goes out before the rest, and what it teaches goes into the brief",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Anything that needs the whole machine (measuring, capturing every preview) waits until every agent is done",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Each report is checked against the work itself: the diff, the tests, the build and how it looks",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Check the work, not the report",
          "text": "Typecheck the whole repository, not file by file",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Check the work, not the report",
          "text": "Run every test",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Check the work, not the report",
          "text": "Run the production build",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Check the work, not the report",
          "text": "Measure everything in one sitting, so the numbers compare",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Check the work, not the report",
          "text": "Look at every result yourself: a preview of each piece, side by side",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Check the work, not the report",
          "text": "Read each piece's credits and source notes, because code copied without its credit breaks its licence",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "A second model as a worker",
          "text": "Give it its own worktree and branch",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "A second model as a worker",
          "text": "Number the prompts and run them in order",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "A second model as a worker",
          "text": "One rules block on every prompt, naming past mistakes",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "A second model as a worker",
          "text": "Review the result, not the report",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "A second model as a worker",
          "text": "Bring its branch up to date after the reviewer's own fixes,",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "A second model as a worker",
          "text": "Use it where the brief can be complete",
          "strength": "idea",
          "kind": "rule"
        }
      ]
    },
    {
      "id": "branching",
      "title": "Branching and forking",
      "group": "together",
      "rules": [
        {
          "section": "Before you start",
          "text": "For each piece, pick its setup: the shared working copy, a worktree of its own, or a separate agent or session (the table below)",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "main always passes typecheck, the tests and the build, and nothing goes in that doesn't",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "One branch per piece, named for it: entry/timeline, fix/phone-overflow",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Branches live for hours or days, not weeks: the longer one lives, the more it collides",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Generated files (lockfiles, build info, measured numbers) are regenerated after a merge, never merged by hand",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Code copied rather than imported is listed in a register, and a test fails when its source changes",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "One owner merges. Workers commit on their own branch and report; they don't merge themselves",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Branches go in one at a time, and the checks run again after each",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Merged worktrees and branches are removed, so the next round starts tidy",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Regenerate, don't merge",
          "text": "A generated file comes out the same on every checkout",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Copies are forks too",
          "text": "Each copy names its source in its header,",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Copies are forks too",
          "text": "Keep a register and a test",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Copies are forks too",
          "text": "Compare bodies, not headers",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Copies are forks too",
          "text": "A copy that differs on purpose says so in its header",
          "strength": "default",
          "kind": "rule"
        }
      ]
    },
    {
      "id": "people",
      "title": "Several people, each with their own agents",
      "group": "together",
      "rules": [
        {
          "section": "Before you start",
          "text": "The contract (types, APIs, folder layout, what \"done\" means) is written down and agreed before anyone's agents start",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "One board in the repository says who is doing what, on which branch",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "People claim work on the board before it starts. Agents don't claim",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "The house rules live in files every agent reads (the brief, the tests), not in anyone's head",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Shared files have named owners, and changes to them go in a pull request of their own",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Nobody approves their own work, and an agent's work counts as the work of the person who ran it",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "What agents must not see is written down: customer code, secrets, other teams' private repositories, because what an agent has read can turn up in anything it writes",
          "strength": "always",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Every session ends with a handover note in the repository, not only in someone's chat",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Review across people",
          "text": "Nobody approves their own work",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "Review across people",
          "text": "The reviewer checks the result, not only the diff",
          "strength": "default",
          "kind": "rule"
        },
        {
          "section": "What agents must not see",
          "text": "Customer and company content",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "What agents must not see",
          "text": "Secrets",
          "strength": "always",
          "kind": "rule"
        },
        {
          "section": "What agents must not see",
          "text": "Other people's work",
          "strength": "always",
          "kind": "rule"
        }
      ]
    },
    {
      "id": "scenes",
      "title": "Scenes that hold up",
      "group": "worlds",
      "rules": [
        {
          "section": "Before you start",
          "text": "Everything stands on the ground along its whole length, not only at its ends or its centre",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Nothing lands on something else: props keep clear of roads, paths, doors and each other",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Parts that meet are built to meet: a roof sits on its walls, a step on its ground, a trim beside its door",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Moving things move as the real thing does, seen from the side as well as from above",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "A pattern's size matches the thing it covers: a paving stone, a plank and a brick at their real sizes",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "No surface flickers: the camera's near plane fits how close it gets, and no two surfaces share a plane",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Before you start",
          "text": "Before calling it done, it was looked at close up, from eye level, from three or four sides, and while the camera moved",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "On the ground at every point",
          "text": "Sample the ground along the thing, not at its ends",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "On the ground at every point",
          "text": "Grade the ground to the thing when it has to be flat",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "On the ground at every point",
          "text": "Stop at a drop rather than span it",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "On the ground at every point",
          "text": "Sample the ground the renderer draws",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "On the ground at every point",
          "text": "Small things sink a little",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Clear of each other",
          "text": "Keep a clearance map",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Clear of each other",
          "text": "Place in order of importance",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Joins that meet",
          "text": "Build the meeting edge from the same numbers",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Joins that meet",
          "text": "Overlap a little rather than touch exactly",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Joins that meet",
          "text": "Look at every join from both sides,",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Motion that is true",
          "text": "Model the pose it moves in",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Motion that is true",
          "text": "Check motion from the side and at eye level,",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Motion that is true",
          "text": "Watch one at full size",
          "strength": "idea",
          "kind": "checklist"
        },
        {
          "section": "Patterns at their real size",
          "text": "Set the pattern's size for what it covers",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Patterns at their real size",
          "text": "Pick the finish for the place",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "No flicker",
          "text": "Set the near plane to how close the camera really comes",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "No flicker",
          "text": "Never put two surfaces in one plane",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Look before it's done",
          "text": "Walk it",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Look before it's done",
          "text": "Turn it",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Look before it's done",
          "text": "Move it",
          "strength": "default",
          "kind": "checklist"
        },
        {
          "section": "Look before it's done",
          "text": "Turn a finding into a check",
          "strength": "default",
          "kind": "checklist"
        }
      ]
    }
  ],
  "shapes": [
    {
      "id": "app-workspace",
      "name": "App workspace",
      "summary": "The work in the middle and the chrome at the edges: a rail, a slim top bar and a details panel, compact and fixed, for tools people work in for hours.",
      "job": "Get their work done without hunting for the controls.",
      "kits": [
        "foundations"
      ],
      "tones": [
        "strict",
        "refined"
      ],
      "looks": [
        "boardroom",
        "atrium",
        "glass",
        "ink",
        "brutalist"
      ],
      "words": [
        "app",
        "web app",
        "editor",
        "workspace",
        "tool",
        "admin",
        "back office",
        "inbox",
        "board",
        "canvas",
        "settings",
        "internal tool"
      ],
      "heading": "App workspace",
      "playbook": "page-shapes"
    },
    {
      "id": "dashboard",
      "name": "Dashboard",
      "summary": "Summary to detail: the one number top left, a row of figures, charts two a row, then the table, all of the first three on a laptop’s first screen.",
      "job": "Know within five seconds whether all is well, then find out why not.",
      "kits": [
        "dashboard",
        "foundations"
      ],
      "tones": [
        "strict",
        "refined"
      ],
      "looks": [
        "boardroom",
        "atrium",
        "holo",
        "orrery",
        "glass",
        "undertow"
      ],
      "words": [
        "dashboard",
        "analytics",
        "kpi",
        "metrics",
        "report",
        "monitoring",
        "control room",
        "overview",
        "scorecard",
        "status",
        "figures",
        "duty desk",
        "operations",
        "ops",
        "live board",
        "dispatch",
        "on shift",
        "situation room",
        "command centre",
        "command center"
      ],
      "heading": "Dashboard",
      "playbook": "page-shapes"
    },
    {
      "id": "product-reveal",
      "name": "Product reveal",
      "summary": "One object in full-bleed scenes as you scroll, one claim a scene with the copy beside it, the specifications last and the call at the end.",
      "job": "Understand what the object is and why it is special, and want it.",
      "kits": [
        "product-presentation",
        "foundations"
      ],
      "tones": [
        "refined",
        "playful"
      ],
      "looks": [
        "specimen",
        "orrery",
        "grid",
        "splash",
        "ink"
      ],
      "words": [
        "product reveal",
        "launch",
        "product page",
        "showcase",
        "unveil",
        "teaser",
        "new model",
        "3d product",
        "configurator",
        "pre-order",
        "cinematic",
        "hero product",
        "new product",
        "product film",
        "scroll story",
        "product story"
      ],
      "heading": "Product reveal",
      "playbook": "page-shapes"
    },
    {
      "id": "service-landing",
      "name": "Service landing",
      "summary": "What it does and for whom in one screen, then proof, how it works, features, pricing and questions, with one call repeated down the page.",
      "job": "Decide whether the service is for them, and try it.",
      "kits": [
        "foundations"
      ],
      "tones": [
        "refined",
        "playful"
      ],
      "looks": [
        "atrium",
        "glass",
        "ink",
        "boardroom"
      ],
      "words": [
        "landing page",
        "saas",
        "service",
        "pricing",
        "sign up",
        "free trial",
        "startup",
        "marketing site",
        "waitlist",
        "subscription",
        "features"
      ],
      "heading": "Service landing",
      "playbook": "page-shapes"
    },
    {
      "id": "story",
      "name": "Story or long read",
      "summary": "One column of reading width in chapters, pictures that break out of it, a contents list and progress, and scroll scenes used sparingly.",
      "job": "Read it through and come away with it.",
      "kits": [
        "foundations"
      ],
      "tones": [
        "refined",
        "playful"
      ],
      "looks": [
        "ink",
        "boardroom",
        "orrery"
      ],
      "words": [
        "story",
        "long read",
        "article",
        "essay",
        "case study",
        "history",
        "blog post",
        "making of",
        "how we built",
        "chronicle",
        "journey",
        "diary"
      ],
      "heading": "Story or long read",
      "playbook": "page-shapes"
    },
    {
      "id": "personal-homepage",
      "name": "Personal homepage",
      "summary": "Who they are, what they make, a grid of chosen work and how to reach them: short, personal and quick to scan.",
      "job": "Decide whether this is someone to work with or follow, and how to reach them.",
      "kits": [
        "foundations"
      ],
      "tones": [
        "playful",
        "refined"
      ],
      "looks": [
        "ink",
        "splash",
        "comic",
        "fling",
        "atrium"
      ],
      "words": [
        "portfolio",
        "about me",
        "personal site",
        "personal homepage",
        "cv",
        "resume",
        "freelancer",
        "my work",
        "artist",
        "photographer",
        "designer"
      ],
      "heading": "Personal homepage",
      "playbook": "page-shapes"
    },
    {
      "id": "event",
      "name": "Event",
      "summary": "What, when and where with the call on the first screen, then the programme and how to come, on a page that changes before, during and after the day.",
      "job": "Decide to come, and come at the right time to the right place.",
      "kits": [
        "foundations"
      ],
      "tones": [
        "refined",
        "playful"
      ],
      "looks": [
        "atrium",
        "atmos",
        "splash",
        "comic",
        "grid"
      ],
      "words": [
        "event",
        "conference",
        "meetup",
        "festival",
        "wedding",
        "opening",
        "workshop",
        "concert",
        "programme",
        "schedule",
        "tickets",
        "rsvp",
        "register"
      ],
      "heading": "Event",
      "playbook": "page-shapes"
    },
    {
      "id": "shop",
      "name": "Shop",
      "summary": "Find, compare, decide, buy: a listing with filters, a product page with the add button in reach, a basket and a one-column checkout.",
      "job": "Find the thing, be sure it is right, and buy it without friction.",
      "kits": [
        "shop",
        "foundations"
      ],
      "tones": [
        "refined",
        "playful",
        "strict"
      ],
      "looks": [
        "atrium",
        "glass",
        "fling",
        "ink"
      ],
      "words": [
        "shop",
        "store",
        "online shop",
        "e-commerce",
        "catalogue",
        "basket",
        "cart",
        "checkout",
        "order online",
        "buy",
        "products"
      ],
      "heading": "Shop",
      "playbook": "page-shapes"
    },
    {
      "id": "game",
      "name": "Game",
      "summary": "The play fills the screen with no page around it; the HUD keeps to the corners and menus open over the paused world.",
      "job": "Play.",
      "kits": [
        "game",
        "foundations"
      ],
      "tones": [
        "playful",
        "refined",
        "strict"
      ],
      "looks": [
        "comic",
        "fling",
        "grid",
        "splash"
      ],
      "words": [
        "game",
        "play",
        "arcade",
        "puzzle",
        "racing",
        "party game",
        "browser game",
        "level",
        "multiplayer",
        "high score"
      ],
      "heading": "Game",
      "playbook": "page-shapes"
    }
  ],
  "entries": [
    {
      "id": "accessible-dialog",
      "aliases": [],
      "name": "Accessible dialogs: modal, sheet, confirm",
      "summary": "One small dialog core that does the whole job: a modal, side and bottom sheets you can drag away, and awaitable confirm() and prompt(). The page behind goes inert, its scroll locks without a jump, focus lands on the right control and comes back, Esc and the backdrop close only the top of a stack, and the motion respects reduced motion and never blocks a fast reopen. Restyle it through its parts.",
      "category": "ui",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "dialog",
        "modal",
        "bottom sheet",
        "confirm",
        "alertdialog",
        "inert",
        "focus management",
        "scroll lock",
        "accessibility",
        "keyboard",
        "touch",
        "rtl",
        "dom",
        "css",
        "no dependencies"
      ],
      "useCases": [
        "forms and settings in a modal",
        "destructive confirmations",
        "mobile bottom sheets and side panels",
        "quick one-line prompts",
        "stacked flows (a confirm over a sheet over a dialog)"
      ],
      "interaction": "Open each kind from the page or the controls · Tab stays inside · Esc closes the top one · drag a sheet’s grip to close",
      "kits": [
        {
          "kit": "foundations",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "steady-fields",
          "why": "The fields inside a prompt or form sheet"
        },
        {
          "id": "hold-to-confirm",
          "why": "A held button for the destructive choice in a confirm"
        },
        {
          "id": "keyboard-shortcuts",
          "why": "Scopes, so shortcuts pause while a dialog is open"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.01,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the demo opening and closing its dialogs from code, one step every 24 frames: the profile form, the side sheet, the stack of three (dialog, sheet, confirm), the destructive confirm and the bottom sheet. Each open builds or re-shows a layer, makes the page inert, locks its scroll and moves focus; each close gives it all back. Nothing runs between steps."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 0.01,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 76 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.02,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 50 ms."
        }
      ],
      "signatures": [
        {
          "file": "confirm.ts",
          "declarations": "import { type DialogOptions } from './dialog';\ntype Shared = Pick<DialogOptions, 'host' | 'scroller' | 'reducedMotion' | 'closeOnBackdrop' | 'returnFocus' | 'className' | 'width' | 'animate'>;\nexport type ConfirmOptions = Shared & {\n    title: string;\n    body?: string;\n    confirm?: string;\n    cancel?: string;\n    tone?: 'default' | 'danger';\n};\nexport declare function confirm(options: ConfirmOptions): Promise<boolean>;\nexport type PromptOptions = Shared & {\n    title: string;\n    body?: string;\n    label: string;\n    value?: string;\n    placeholder?: string;\n    type?: 'text' | 'email' | 'url' | 'number' | 'search' | 'tel';\n    autocomplete?: string;\n    maxLength?: number;\n    confirm?: string;\n    cancel?: string;\n    validate?: (value: string) => string | null;\n};\nexport declare function prompt(options: PromptOptions): Promise<string | null>;\nexport {};"
        },
        {
          "file": "dialog.ts",
          "declarations": "export type DialogKind = 'modal' | 'sheet';\nexport type SheetSide = 'bottom' | 'end' | 'start';\nexport type CloseReason = 'escape' | 'backdrop' | 'button' | 'swipe' | 'api';\nexport type DialogOptions = {\n    title: string;\n    description?: string;\n    content?: Node | string;\n    footer?: Node;\n    kind?: DialogKind;\n    side?: SheetSide;\n    role?: 'dialog' | 'alertdialog';\n    width?: string;\n    host?: HTMLElement;\n    scroller?: HTMLElement | null;\n    initialFocus?: HTMLElement | string | (() => HTMLElement | null | undefined);\n    returnFocus?: HTMLElement | null;\n    closeOnEscape?: boolean;\n    closeOnBackdrop?: boolean;\n    closeButton?: boolean | string;\n    swipeToClose?: boolean;\n    reducedMotion?: boolean;\n    beforeClose?: (reason: CloseReason) => boolean | Promise<boolean>;\n    onOpen?: () => void;\n    onClose?: (value: unknown, reason: CloseReason) => void;\n    destroyOnClose?: boolean;\n    className?: string;\n    animate?: (layer: HTMLElement, phase: 'open' | 'close') => Promise<unknown> | void;\n};\nexport type Dialog<T = string> = {\n    readonly layer: HTMLElement;\n    readonly panel: HTMLElement;\n    readonly body: HTMLElement;\n    readonly footer: HTMLElement;\n    readonly isOpen: boolean;\n    open(): Promise<T | undefined>;\n    close(value?: T, reason?: CloseReason): Promise<boolean>;\n    destroy(): void;\n};\nexport declare function tabbables(root: HTMLElement): HTMLElement[];\nexport declare function createDialog<T = string>(options: DialogOptions): Dialog<T>;\nexport declare function openCount(host?: HTMLElement): number;\nexport declare function closeAll(host?: HTMLElement): void;"
        }
      ],
      "pitfalls": [
        "Import dialog.base.css before dialog.css (or your own look)",
        "Inert covers what is in the host when the dialog opens",
        "A host other than document.body must be positioned (relative, absolute…) and should not scroll",
        "A frosted panel (backdrop-filter) in a host that is itself frosted, or has a filter",
        "Toasts and live regions inside an inert page are silent while a dialog is open",
        "Act on the promise, not on clicks",
        "beforeClose runs for user closes only (Esc, backdrop, close buttons, swipe)",
        "position: fixed elements on the page",
        "Do not open a dialog from pointerdown if you can help it",
        "Opening one inside a full-screen element needs that element as host"
      ],
      "card": "entries/accessible-dialog.json"
    },
    {
      "id": "agent-senses",
      "aliases": [],
      "name": "Agent senses, cover and squads",
      "summary": "Agents that see, hear and hide as a group: sight with a range and a cone (shorter at night, noticing anything close), hearing by pace and voice with a front that travels, cover spots read from the walls and boxes you already have (low cover to rise over, high cover to lean round), scored to face the threat and keep mates apart and out of each other’s line of view, turns so only a few look out at once, call-outs that are heard and passed on, and regrouping round a point. Pure TypeScript on a walk grid; the demo’s squad hides from a sweeping searchlight.",
      "category": "simulation",
      "role": "system",
      "stack": [
        "headless"
      ],
      "character": "calm",
      "tags": [
        "ai",
        "agents",
        "npc",
        "perception",
        "sight cone",
        "line of sight",
        "hearing",
        "cover",
        "cover points",
        "squad",
        "group behaviour",
        "turn taking",
        "stealth",
        "searchlight",
        "call-outs",
        "regroup",
        "pathfinding",
        "walk grid",
        "state machine",
        "three.js",
        "no dependencies"
      ],
      "useCases": [
        "sentries and watchers that see and hear in a stealth game",
        "a group of agents that hide from a light, a camera or a patrol",
        "NPCs that take cover behind walls and crates without hand-placed cover nodes",
        "turn-taking so only a few agents act at once (look out, go first, speak)",
        "wildlife that hears footsteps and flees together",
        "crowd or evacuation simulations where people call to each other and regroup",
        "minimap sight cones that respect walls"
      ],
      "interaction": "Tap the ground: the lead calls the squad there · drag to orbit",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "humanoid-rig",
          "why": "Bodies that walk where the squad decides"
        },
        {
          "id": "ray-grid",
          "why": "Cheap line of sight in big scenes"
        },
        {
          "id": "game-cameras",
          "why": "Third-person cameras for stealth play"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-13",
          "gpuMs": 0.733,
          "cpuMs": 0.6,
          "cpuP95Ms": 0.84,
          "badge": "moderate",
          "drawCalls": 99,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured as it runs by itself: eight agents hiding from the sweeping light on its moving mast, two lookouts taking turns, call-outs and regroups as they happen; sight cones (34 rays each against 30 solids at 30 Hz), cover spots, call rings and a 1024² spot-light shadow on."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 2.49,
          "cpuMs": 1.49,
          "cpuP95Ms": 2.245,
          "badge": "heavy",
          "drawCalls": 93,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 362 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 3.983,
          "cpuMs": 0.74,
          "cpuP95Ms": 3.74,
          "badge": "heavy",
          "drawCalls": 105,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 1035 ms."
        }
      ],
      "signatures": [
        {
          "file": "callouts.ts",
          "declarations": "export type Call<K extends string = string> = {\n    id: number;\n    by: string;\n    kind: K;\n    x: number;\n    z: number;\n    at: number;\n    reach: number;\n    about?: {\n        x: number;\n        z: number;\n    };\n    relayOf?: number;\n};\nexport type Listener = {\n    id: string;\n    x: number;\n    z: number;\n    ears?: number;\n};\nexport type Heard<K extends string = string> = {\n    listener: string;\n    call: Call<K>;\n    distance: number;\n};\nexport declare class Callouts<K extends string = string> {\n    speed: number;\n    linger: number;\n    remember: number;\n    readonly calls: Call<K>[];\n    constructor(speed?: number, linger?: number);\n    call(by: string, kind: K, from: {\n        x: number;\n        z: number;\n    }, reach: number, now: number, extra?: {\n        about?: {\n            x: number;\n            z: number;\n        };\n        relayOf?: number;\n    }): Call<K>;\n    radius(call: Call<K>, now: number): number;\n    progress(call: Call<K>, now: number): number;\n    strength(call: Call<K>, now: number): number;\n    step(now: number, listeners: Iterable<Listener>): Heard<K>[];\n    hasHeard(listener: string, callId: number): boolean;\n    clear(): void;\n}"
        },
        {
          "file": "searchlight.ts",
          "declarations": "export interface Sweep {\n    from: number;\n    to: number;\n    seconds: number;\n    reach: number;\n}\nexport declare function makeSweep(fromDeg: number, toDeg: number, seconds?: number, reach?: number): Sweep;\nexport declare const sweepsRound: (sweep: Sweep) => boolean;\nexport declare function sweepTurn(sweep: Sweep, t: number, phase?: number): number;\nexport declare const sweepTilt: (drop: number, reach: number) => number;\nexport declare function beamDirection(yaw: number, tilt: number): {\n    x: number;\n    y: number;\n    z: number;\n};\nexport type V3 = {\n    x: number;\n    y: number;\n    z: number;\n};\nexport declare function inBeam(lamp: V3, direction: V3, halfAngle: number, range: number, point: V3): boolean;\nexport declare function beamGround(lamp: V3, direction: V3, range: number, heightAt: (x: number, z: number) => number): {\n    distance: number;\n    x: number;\n    y: number;\n    z: number;\n};\nexport declare function sweepPhase(x: number, z: number): number;"
        },
        {
          "file": "sight.ts",
          "declarations": "export declare const DAY_SIGHT = 42;\nexport declare const NIGHT_SIGHT = 17;\nexport declare const NOTICE_CLOSE = 4.5;\nexport declare const HALF_VIEW: number;\nexport type SightConditions = {\n    night: boolean;\n    sneaking: boolean;\n    running: boolean;\n    seenFrom?: number;\n};\nexport declare function sightRange({ night, sneaking, running, seenFrom }: SightConditions, eyes?: number): number;\nexport type Viewer = {\n    x: number;\n    z: number;\n    facing: number;\n};\nexport declare function withinSight(viewer: Viewer, target: {\n    x: number;\n    z: number;\n}, range: number, halfView?: number, close?: number): boolean;\nexport type Pace = 'still' | 'sneak' | 'stroll' | 'jog' | 'run' | 'engine';\nexport declare const FOOTSTEPS: Record<Pace, number>;\nexport declare const VOICE: {\n    readonly word: 6;\n    readonly call: 16;\n    readonly shout: 28;\n};\nexport type Voice = keyof typeof VOICE;\nexport declare function footstepReach(pace: Pace, ears?: number, noise?: number, worn?: number): number;\nexport declare const voiceReach: (voice: Voice, ears?: number) => number;\nexport declare function notices(viewer: Viewer, target: {\n    x: number;\n    z: number;\n}, range: number, reach: number, halfView?: number, close?: number): {\n    heard: boolean;\n    inSight: boolean;\n};"
        },
        {
          "file": "squad.ts",
          "declarations": "import { type CoverRole, type CoverSpot } from './cover-points';\nimport { CoverMind, type Intent } from './mind';\nimport { Turns, type TurnSettings } from './turns';\nexport type SquadSettings = TurnSettings & {\n    searchesPerStep: number;\n    proneFrom: number;\n    rallyRing: number;\n};\nexport declare const DEFAULT_SQUAD: SquadSettings;\nexport type Member = {\n    id: string;\n    squad: string;\n    x: number;\n    z: number;\n    sees: boolean;\n    startledAt: number;\n    range: number;\n    arrived: boolean;\n};\nexport type ThreatView = {\n    id: string;\n    x: number;\n    y: number;\n    z: number;\n};\nexport type CoverAsk = {\n    member: Member;\n    role: CoverRole;\n    threat: ThreatView;\n    taken: (id: string) => boolean;\n    mates: ReadonlyArray<{\n        x: number;\n        z: number;\n    }>;\n    middle: {\n        x: number;\n        z: number;\n    };\n    near: {\n        x: number;\n        z: number;\n    };\n    regrouping: boolean;\n};\nexport interface SquadWorld {\n    findCover(ask: CoverAsk): CoverSpot | null;\n    coverHolds(member: Member, spot: CoverSpot, threat: ThreatView): boolean;\n    open?(x: number, z: number): boolean;\n}\nexport type Engagement = {\n    threat: ThreatView;\n    members: readonly Member[];\n    ceiling?: number;\n};\nexport type StepResult = {\n    intents: Map<string, Intent>;\n    holders: ReadonlySet<string>;\n};\nexport declare const poolOf: (threat: string, squad: string) => string;\nexport declare class SquadDirector {\n    readonly settings: SquadSettings;\n    readonly turns: Turns;\n    readonly minds: Map<string, CoverMind>;\n    constructor(settings?: Partial<SquadSettings>);\n    mind(member: {\n        id: string;\n    }): CoverMind;\n    forget(id: string): void;\n    hush(id: string, now: number, seconds: number): void;\n    regroup(id: string, at: {\n        x: number;\n        z: number;\n    }, now: number, seconds?: number): void;\n    rallyOf(id: string): {\n        x: number;\n        z: number;\n    } | null;\n    holderOf(spot: string): string | null;\n    busy(threat: string, squads: Iterable<string>): number;\n    step(now: number, threat: ThreatView, members: readonly Member[], world: SquadWorld, ceiling?: number): StepResult;\n    stepAll(now: number, engagements: readonly Engagement[], world: SquadWorld): StepResult;\n}"
        },
        {
          "file": "world.ts",
          "declarations": "import { CoverField, type CoverBlocked, type CoverColliders, type CoverRole, type CoverSpot, type Ground, type Peek } from './cover-points';\nimport type { CoverAsk, Member, SquadWorld, ThreatView } from './squad';\nexport type V3 = {\n    x: number;\n    y: number;\n    z: number;\n};\nexport declare function segmentHit(a: V3, b: V3, colliders: CoverColliders): number;\nexport declare function lineClear(a: V3, b: V3, colliders: CoverColliders, slack?: number): boolean;\nexport type FanOptions = {\n    eye: number;\n    range: number;\n    halfView?: number;\n    close?: number;\n    cone?: number;\n    back?: number;\n};\nexport declare function sightFan(viewer: {\n    x: number;\n    z: number;\n    facing: number;\n}, o: FanOptions, colliders: CoverColliders, out?: Float32Array): Float32Array;\nexport type ColliderWorldOptions = {\n    ground?: Ground;\n    blocked?: CoverBlocked;\n    reach?: Partial<Record<CoverRole, number>>;\n    regroupReach?: number;\n    band?: (member: Member, role: CoverRole) => [\n        number,\n        number\n    ];\n    terrain?: boolean;\n    cell?: number;\n};\nexport declare const REACH: Record<CoverRole, number>;\nexport declare class ColliderWorld implements SquadWorld {\n    readonly field: CoverField;\n    colliders: CoverColliders;\n    rays: number;\n    constructor(colliders: CoverColliders, options?: ColliderWorldOptions);\n    spotsNear(x: number, z: number, radius: number): CoverSpot[];\n    findCover(ask: CoverAsk): CoverSpot | null;\n    coverHolds(_m: Member, spot: CoverSpot, threat: ThreatView): boolean;\n    open(x: number, z: number): boolean;\n    hidden(spot: CoverSpot, threat: V3): boolean;\n    seesFrom(spot: CoverSpot, peek: Peek, threat: V3): boolean;\n}"
        }
      ],
      "pitfalls": [
        "A cover spot hides only from the side it faces",
        "Give the threat’s `y` as the height it sees from",
        "The cover field caches per collider set by identity",
        "Cover searches are rationed (searchesPerStep, shared by every body)",
        "A mind never searches itself",
        "band defaults to the source’s fighting distances (a quarter to seven tenths of the body’s range)",
        "A call’s front travels at `speed`",
        "A relay is a new call with `relayOf` set to the first one",
        "Hush and turns pull against each other",
        "sightFan is level at the eye",
        "Facings are atan2(dx, dz) (0 along +z), as three.js yaw is"
      ],
      "card": "entries/agent-senses.json"
    },
    {
      "id": "alpha-mips",
      "aliases": [],
      "name": "Coverage-keeping atlas mipmaps",
      "summary": "Build explicit RGBA mipmaps for alpha-tested atlases so thin leaves, stems and fence wire survive minification. Each cell targets its own base coverage; alpha-weighted RGB avoids transparent-colour fringes, and an uncorrected pyramid prevents opacity boosts from accumulating. Pure CPU preprocessing with no renderer dependency.",
      "category": "technique",
      "role": "system",
      "stack": [
        "headless"
      ],
      "character": "calm",
      "tags": [
        "alpha test",
        "mipmaps",
        "atlas",
        "coverage",
        "foliage",
        "leaves",
        "fences",
        "cutouts",
        "texture filtering",
        "CPU"
      ],
      "useCases": [
        "keep thin alpha-tested foliage visible at a distance",
        "preserve sparse fence wire through mip reduction",
        "build per-cell atlas mipmaps without loading source art",
        "avoid transparent RGB fringes and cumulative opacity inflation"
      ],
      "interaction": "Compare plain and corrected mipmaps · change distance or cutoff · Near view and Far view keep both cameras matched",
      "kits": [],
      "pairsWith": [
        {
          "id": "instance-cull",
          "why": "Cull foliage instances while these mipmaps keep the remaining cutouts readable at a distance"
        },
        {
          "id": "meadow-grass",
          "why": "A complementary approach for texture-backed foliage cards rather than procedural blades"
        },
        {
          "id": "compile-without-stalls",
          "why": "Prepare atlas textures and alpha-tested materials before first use"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 0.155,
          "cpuMs": 0.185,
          "cpuP95Ms": 0.305,
          "badge": "light",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.103,
            "p99Ms": 6.145,
            "low1Fps": 148.9
          },
          "notes": "Two synchronized views of one code-generated 256×256 RGBA atlas on identical quads. Left uses an uncorrected box-filter chain, right uses per-cell coverage correction; both use alpha-weighted RGB, alpha test and trilinear filtering. Mips build on load/cutoff edits, not per frame. No automatic motion, external textures, blending, alpha-to-coverage or lighting."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "intel xe-2lpg",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Microsoft Edge 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 2.425,
          "cpuMs": 0.935,
          "cpuP95Ms": 1.76,
          "badge": "heavy",
          "drawCalls": 17,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Microsoft Edge 157, Chromium 157 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 397 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 3.029,
          "cpuMs": 0.22,
          "cpuP95Ms": 0.68,
          "badge": "heavy",
          "drawCalls": 17,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 493 ms."
        }
      ],
      "signatures": [
        {
          "file": "alpha-mips.ts",
          "declarations": "export type RgbaMip = {\n    data: Uint8Array;\n    width: number;\n    height: number;\n};\nexport declare function alphaCoverageMips(base: RgbaMip, cellPixels: number, cutoff?: number): RgbaMip[];"
        }
      ],
      "pitfalls": [
        "Input is tightly packed unpremultiplied RGBA8 in a Uint8Array",
        "cutoff is a byte threshold from 1 to 255, not a normalized 0–1 value",
        "Coverage is a heuristic, not exact area conservation",
        "Cells remain independent only while each is at least one mip texel",
        "Never feed a corrected mip back into the next average",
        "RGB is alpha-weighted in the supplied byte space, not automatically linearized",
        "The returned array includes the original base object at level zero",
        "Upload the whole explicit chain including level zero",
        "This is for alpha-tested cutouts, not ordinary alpha blending",
        "Build on load or asset/cutoff edits, never each frame"
      ],
      "card": "entries/alpha-mips.json"
    },
    {
      "id": "ambient-swarms",
      "aliases": [],
      "name": "Ambient GPU swarms",
      "summary": "Flies over a pond, fireflies at dusk, a starling murmuration and long-gliding gulls: nine kinds of small flyers with their own shapes and flight patterns. Stochastic flocking samples six or twelve neighbours per flyer, so work grows linearly with the population. One compute dispatch and one instanced draw per moving swarm; homes, threats, wind and an optional coast stencil are the only inputs from the host.",
      "category": "particles",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "balanced",
      "tags": [
        "swarm",
        "flocking",
        "birds",
        "insects",
        "fireflies",
        "gulls",
        "starlings",
        "ambient",
        "compute",
        "instancing",
        "tsl",
        "reduced motion",
        "no readback"
      ],
      "useCases": [
        "ambient birds and insects in a landscape",
        "a murmuration responding to a cursor",
        "fireflies around a moving focus",
        "several patches of flies in one draw",
        "gulls constrained to a supplied shoreline"
      ],
      "interaction": "Move the cursor to repel flyers · drag to orbit · scroll to zoom · Scatter is the keyboard equivalent",
      "kits": [],
      "pairsWith": [
        {
          "id": "rain-snow",
          "why": "The host can gate populations with its weather"
        },
        {
          "id": "water-ripples",
          "why": "A pond below the flyers"
        },
        {
          "id": "physical-sky",
          "why": "Light the species for the time of day"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "Half the flyers; six sampled flock-mates per flyer",
          "low": "One fifth of the flyers; six sampled flock-mates per flyer"
        },
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "count",
          "in": "module",
          "values": {
            "strict": 40,
            "refined": 300,
            "playful": 9000
          },
          "note": "Population at construction; larger values increase compute and geometry work linearly"
        },
        {
          "name": "wander",
          "in": "module",
          "values": {
            "strict": 0.1,
            "refined": 0.5,
            "playful": 2
          },
          "note": "How independently each flyer drifts through the curl flow"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 0.214,
          "cpuMs": 0.27,
          "cpuP95Ms": 0.435,
          "badge": "light",
          "drawCalls": 8,
          "computeDispatches": 4,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.517,
            "p99Ms": 6.165,
            "low1Fps": 151.8
          },
          "notes": "Four active kinds: 9,000 starlings, 400 flies, 300 fireflies and 12 gulls at high tier. One compute and one swarm draw per active kind, plus a static pond and reeds. The pointer is idle. No readback. The demo rests after 30 seconds; benchmark mode keeps it moving."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "intel xe-2lpg",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Microsoft Edge 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 2.163,
          "cpuMs": 0.97,
          "cpuP95Ms": 1.56,
          "badge": "heavy",
          "drawCalls": 28,
          "computeDispatches": 4,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Microsoft Edge 157, Chromium 157 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 5623 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 1.522,
          "cpuMs": 0.1,
          "cpuP95Ms": 0.14,
          "badge": "moderate",
          "drawCalls": 28,
          "computeDispatches": 4,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 6360 ms."
        }
      ],
      "signatures": [
        {
          "file": "coast-swarms.ts",
          "declarations": "export interface WorkBudget {\n    now(): number;\n    open(): boolean;\n    charge(task: string, milliseconds: number): void;\n}\nexport declare const COAST_CELLS = 64, COAST_CELL = 2, COAST_FOCUS = 32, GULL_HOMES = 16;\nexport type CoastSample = {\n    sea: number | null;\n    ground: number | null;\n    sand: boolean;\n};\nexport type CoastPatch = {\n    x: number;\n    z: number;\n    data: Float32Array;\n    homes: Array<{\n        x: number;\n        y: number;\n        z: number;\n        perch: {\n            x: number;\n            y: number;\n            z: number;\n        } | null;\n    }>;\n};\nexport type CoastSource = {\n    revision: unknown;\n    waterRevision?: unknown;\n    sample: (x: number, z: number) => CoastSample;\n};\nexport declare function buildCoastPatch(x: number, z: number, sample: CoastSource['sample']): CoastPatch;\nexport declare class CoastPatchBuild {\n    constructor(x: number, z: number, sample: CoastSource['sample']);\n    step(budget: WorkBudget): CoastPatch | null;\n}\nexport declare function coastCell(p: CoastPatch, x: number, z: number): number[];"
        },
        {
          "file": "swarm-kinds.ts",
          "declarations": "export type SwarmKind = 'flies' | 'bats' | 'fireflies' | 'starlings' | 'butterflies' | 'gulls' | 'buzzards' | 'songbirds' | 'barn-owls';\nexport declare const SWARM_KINDS: readonly SwarmKind[];\nexport type SwarmSpec = {\n    kind: SwarmKind;\n    count: number;\n    speed: number;\n    slowest: number;\n    agility: number;\n    wander: number;\n    cohesion: number;\n    alignment: number;\n    separation: number;\n    range: number;\n    low: number;\n    high: number;\n    size: number;\n    beat: number;\n    fright: number;\n    colour: string;\n    glow: string;\n};\nexport declare const SWARM_DEFAULTS: Record<SwarmKind, SwarmSpec>;\nexport declare const SWARM_KNOBS: {\n    readonly count: {\n        readonly label: \"Flyers\";\n        readonly min: 1;\n        readonly max: 30000;\n        readonly step: 10;\n        readonly rebuild: true;\n        readonly hint: \"How many fly. One compute pass and one draw however many: a murmuration wants thousands.\";\n    };\n    readonly speed: {\n        readonly label: \"Speed\";\n        readonly unit: \"m/s\";\n        readonly min: 0.1;\n        readonly max: 25;\n        readonly step: 0.1;\n        readonly hint: \"How fast they cruise.\";\n    };\n    readonly agility: {\n        readonly label: \"Agility\";\n        readonly min: 0.5;\n        readonly max: 20;\n        readonly step: 0.1;\n        readonly hint: \"How hard they turn toward where they want to be: flies dart, starlings sweep.\";\n    };\n    readonly wander: {\n        readonly label: \"Wander\";\n        readonly min: 0;\n        readonly max: 5;\n        readonly step: 0.05;\n        readonly hint: \"How much each drifts on its own, through a flow that turns slowly.\";\n    };\n    readonly cohesion: {\n        readonly label: \"Keep together\";\n        readonly min: 0;\n        readonly max: 3;\n        readonly step: 0.05;\n        readonly hint: \"How strongly each is drawn to the flock-mates it hears from.\";\n    };\n    readonly alignment: {\n        readonly label: \"Fly as one\";\n        readonly min: 0;\n        readonly max: 3;\n        readonly step: 0.05;\n        readonly hint: \"How strongly each turns to fly the way its flock-mates fly: the murmuration's waves.\";\n    };\n    readonly separation: {\n        readonly label: \"Keep apart\";\n        readonly min: 0;\n        readonly max: 4;\n        readonly step: 0.05;\n        readonly hint: \"How hard each keeps off the others.\";\n    };\n    readonly range: {\n        readonly label: \"Range\";\n        readonly unit: \"m\";\n        readonly min: 0.5;\n        readonly max: 80;\n        readonly step: 0.5;\n        readonly hint: \"How far round its home the swarm ranges.\";\n    };\n    readonly size: {\n        readonly label: \"Size\";\n        readonly unit: \"m\";\n        readonly min: 0.01;\n        readonly max: 1.6;\n        readonly step: 0.005;\n        readonly hint: \"Wingspan.\";\n    };\n    readonly beat: {\n        readonly label: \"Wingbeats\";\n        readonly unit: \"/s\";\n        readonly min: 1;\n        readonly max: 250;\n        readonly step: 1;\n        readonly hint: \"Wingbeats a second: a fly blurs, a butterfly flutters.\";\n    };\n    readonly fright: {\n        readonly label: \"Fright\";\n        readonly unit: \"m\";\n        readonly min: 0;\n        readonly max: 30;\n        readonly step: 0.5;\n        readonly hint: \"How far off a threat (the hawk, your cursor) scatters them.\";\n    };\n};\nexport declare function swarmSpec(kind: SwarmKind, change?: Partial<SwarmSpec>): SwarmSpec;\nexport declare function flyerShape(kind: SwarmKind): {\n    positions: number[];\n    flap: number[];\n    stand: number[];\n};"
        },
        {
          "file": "swarm.ts",
          "declarations": "import type { CoastPatch } from './coast-swarms';\nimport * as THREE from 'three/webgpu';\nimport { type SwarmSpec } from './swarm-kinds';\nexport declare const SWARM_QUALITY: {\n    readonly game: {\n        readonly mates: 6;\n        readonly markings: false;\n    };\n    readonly stage: {\n        readonly mates: 12;\n        readonly markings: true;\n    };\n};\nexport type SwarmQuality = keyof typeof SWARM_QUALITY;\nexport declare class Swarm {\n    readonly mesh: THREE.Mesh;\n    spec: SwarmSpec;\n    readonly homes: number;\n    readonly threat: THREE.UniformNode<\"vec4\", THREE.Vector4>;\n    readonly roam: THREE.UniformNode<\"float\", number>;\n    readonly quality: SwarmQuality;\n    readonly gather: THREE.UniformNode<\"float\", number>;\n    constructor(spec: SwarmSpec, homes?: number, quality?: SwarmQuality, options?: {\n        targets?: boolean;\n    });\n    setKnobs(spec: SwarmSpec): void;\n    setHome(k: number, x: number, groundY: number, z: number, on: boolean): void;\n    setTargets(points: ArrayLike<number>): void;\n    setCoast(patch: CoastPatch): void;\n    setWind(wind: {\n        x: number;\n        z: number;\n    }, gust?: {\n        time: number;\n        travel: THREE.Vector2;\n    }): void;\n    scatter(): void;\n    update(renderer: THREE.WebGPURenderer, dt: number, options?: {\n        reducedMotion?: boolean;\n    }): boolean;\n    dispose(): void;\n}"
        }
      ],
      "pitfalls": [
        "The demo needs WebGPU for compute and storage buffers",
        "Add the mesh without transforming it",
        "Each active swarm submits one compute dispatch and one instanced draw, not constant total cost",
        "The two banks prevent neighbours from reading partially updated positions",
        "Kind, count, homes, quality and target allocation are construction choices. setKnobs changes…",
        "Call update before drawing, once per moving frame. dt is seconds",
        "Gulls stay hidden until setCoast supplies a valid 64×64 RGBA float stencil and homes.…",
        "Coast heights are constant cell floors, not collision geometry",
        "A threat is xyz plus a radius multiplier in w (zero disables it)",
        "Visibility help caps enlargement at twice the authored wingspan"
      ],
      "card": "entries/ambient-swarms.json"
    },
    {
      "id": "appearance-theme",
      "aliases": [],
      "name": "Appearance: themes, contrast, text size, density, motion",
      "summary": "A small appearance system: colour presets as CSS variables (light, dark, two high-contrast, two accent looks), a “Match system” choice that follows the device’s colour scheme and contrast, any number of looks (data-look and their own tokens), text size, density and motion; stored choices checked on read, other tabs following, theme changes that fade three ways (a view transition, colours that glide through @property, or a palette blended frame by frame that a canvas or shader can follow), a mood per preset that fades with the colours, a script that applies it all before the first paint, a contrast audit, and an accessible settings form you can restyle through its parts.",
      "category": "ui",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "theme",
        "dark mode",
        "high contrast",
        "css variables",
        "prefers-color-scheme",
        "prefers-contrast",
        "reduced motion",
        "text size",
        "density",
        "view transitions",
        "@property",
        "oklab",
        "theme transitions",
        "localStorage",
        "wcag",
        "accessibility",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "an app’s appearance settings",
        "dark and light themes without a flash",
        "high-contrast and larger-text options",
        "a compact mode for dense tools",
        "checking a palette against WCAG",
        "a theme change that feels like time passing",
        "keeping a canvas or shader in step with the page’s colours"
      ],
      "interaction": "Pick a theme, size, density or motion: only the preview obeys · arrow keys move within a group",
      "kits": [
        {
          "kit": "foundations",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "effects-switchboard",
          "why": "Motion and sound switches beside the theme settings"
        },
        {
          "id": "command-palette",
          "why": "A Theme › page in the palette"
        },
        {
          "id": "chart-access",
          "why": "Check each preset as people with colour-vision deficiency see it"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "density",
          "in": "module",
          "values": {
            "strict": "compact",
            "refined": "comfortable",
            "playful": "comfortable"
          },
          "note": "the default Appearance; the user can change it"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.315,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured exercising itself: every eighth frame applies the next preset to the preview (twelve custom properties, five attributes), stores it and redraws the form’s state; every third change also steps the text size and density. No cross-fade while measured. Idle, nothing runs."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 0.465,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 49 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 1.06,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 36 ms."
        }
      ],
      "signatures": [
        {
          "file": "appearance.ts",
          "declarations": "import { type Appearance, type DeviceSettings, type LookPreset, type SystemThemes, type ThemePreset } from './themes';\nexport type AppearanceStore = {\n    read(): string | null;\n    write(text: string): void;\n    watch?(onChange: (text: string | null) => void): () => void;\n};\nexport declare function localStore(key: string): AppearanceStore;\nexport type DeviceSource = {\n    get(): DeviceSettings;\n    watch(onChange: () => void): () => void;\n};\nexport declare function mediaDevice(win?: Window): DeviceSource;\nexport type AppearanceCause = 'init' | 'set' | 'reset' | 'storage' | 'device';\nexport type AppearanceState = {\n    appearance: Appearance;\n    theme: ThemePreset;\n    look: LookPreset | null;\n    device: DeviceSettings;\n    reducedMotion: boolean;\n    persisted: boolean;\n};\nexport type AppearanceOptions = {\n    target?: HTMLElement;\n    themes?: readonly ThemePreset[];\n    looks?: readonly LookPreset[];\n    system?: SystemThemes;\n    prefix?: string;\n    store?: AppearanceStore | null;\n    device?: DeviceSource;\n    transition?: boolean | ((commit: () => void, change: {\n        theme: boolean;\n        look: boolean;\n        state: AppearanceState;\n    }) => void);\n    scaleFont?: boolean;\n};\nexport type AppearanceController = {\n    get(): AppearanceState;\n    set(patch: Partial<Appearance>): void;\n    reset(): void;\n    subscribe(listener: (state: AppearanceState, cause: AppearanceCause) => void): () => void;\n    destroy(clear?: boolean): void;\n};\nexport declare function createAppearance(options?: AppearanceOptions): AppearanceController;"
        },
        {
          "file": "boot.ts",
          "declarations": "import { type LookPreset, type SystemThemes, type ThemePreset } from './themes';\nexport type BootOptions = {\n    key?: string;\n    themes?: readonly ThemePreset[];\n    looks?: readonly LookPreset[];\n    system?: SystemThemes;\n    prefix?: string;\n};\nexport declare function bootScript(options?: BootOptions): string;"
        },
        {
          "file": "contrast.ts",
          "declarations": "import type { ThemePreset, ThemeTokens } from './themes';\nexport declare function parseHex(hex: string): [\n    number,\n    number,\n    number\n] | null;\nexport declare function luminance(hex: string): number;\nexport declare function contrastRatio(a: string, b: string): number;\nexport type ContrastCheck = {\n    fg: keyof ThemeTokens;\n    bg: keyof ThemeTokens;\n    ratio: number;\n    need: number;\n    pass: boolean;\n};\ntype Pair = {\n    fg: keyof ThemeTokens;\n    on: Array<keyof ThemeTokens>;\n    text: boolean;\n};\nexport declare const CONTRAST_PAIRS: Pair[];\nexport declare function auditTheme(theme: ThemePreset): ContrastCheck[];\nexport declare function formatRatio(ratio: number): string;\nexport {};"
        },
        {
          "file": "fades.ts",
          "declarations": "import { type ThemePreset } from './themes';\nimport type { AppearanceState } from './appearance';\nexport type FadeHook = (commit: () => void, change: {\n    theme: boolean;\n    look: boolean;\n    state: AppearanceState;\n}) => void;\nexport type FadeOptions = {\n    themes?: readonly ThemePreset[];\n    prefix?: string;\n    ms?: number;\n};\nexport declare function fadeNames(themes?: readonly ThemePreset[], prefix?: string): {\n    colours: string[];\n    moods: string[];\n};\nexport declare function parseColour(text: string): [\n    number,\n    number,\n    number,\n    number\n] | null;\nexport declare function toOklab([r, g, b]: readonly number[]): [\n    number,\n    number,\n    number\n];\nexport declare function fromOklab([L, a, b]: readonly number[]): [\n    number,\n    number,\n    number\n];\nexport declare function mixValue(a: string, b: string, k: number): string;\nexport declare function propertyFade(target: HTMLElement, { themes, prefix, ms, easing }?: FadeOptions & {\n    easing?: string;\n}): FadeHook;\nexport type BlendFrame = {\n    k: number;\n    t: number;\n    from: Readonly<Record<string, string>>;\n    to: Readonly<Record<string, string>>;\n    now: Readonly<Record<string, string>>;\n};\nexport declare function paletteBlend(target: HTMLElement, { themes, prefix, ms, ease, onFrame, frame, cancel, }?: FadeOptions & {\n    ease?: (t: number) => number;\n    onFrame?: (f: BlendFrame) => void;\n    frame?: (cb: FrameRequestCallback) => number;\n    cancel?: (id: number) => void;\n}): FadeHook & {\n    stop(): void;\n};\nexport declare function packPalette(theme: ThemePreset, keys: readonly (keyof ThemePreset['tokens'])[], moods?: readonly string[], out?: Float32Array<ArrayBuffer>): Float32Array;\nexport declare function mixPacked(a: Float32Array, b: Float32Array, k: number, out?: Float32Array<ArrayBuffer>): Float32Array;"
        },
        {
          "file": "form.ts",
          "declarations": "import type { AppearanceController } from './appearance';\nimport { type Appearance, type LookPreset, type SystemThemes, type ThemePreset } from './themes';\nexport type AppearanceFormLabels = {\n    theme: string;\n    themeHint: string;\n    system: string;\n    systemNow: (theme: string) => string;\n    look: string;\n    lookHint: string;\n    scale: string;\n    scales: Record<Appearance['scale'], string>;\n    density: string;\n    comfortable: string;\n    compact: string;\n    motion: string;\n    motionSystem: string;\n    motionSystemNow: (reduced: boolean) => string;\n    motionReduce: string;\n    motionReduceHint: string;\n    saved: string;\n    notSaved: string;\n    fromElsewhere: string;\n    reset: string;\n};\nexport declare const FORM_LABELS: AppearanceFormLabels;\nexport type AppearanceFormOptions = {\n    themes?: readonly ThemePreset[];\n    looks?: readonly LookPreset[];\n    system?: SystemThemes;\n    labels?: Partial<AppearanceFormLabels>;\n    idPrefix?: string;\n};\nexport type AppearanceForm = {\n    element: HTMLFormElement;\n    destroy(): void;\n};\nexport declare function appearanceForm(host: HTMLElement, controller: AppearanceController, options?: AppearanceFormOptions): AppearanceForm;"
        },
        {
          "file": "themes.ts",
          "declarations": "export type ThemeTokens = {\n    bg: string;\n    surface: string;\n    raised: string;\n    text: string;\n    muted: string;\n    border: string;\n    accent: string;\n    onAccent: string;\n    focus: string;\n    success: string;\n    warning: string;\n    danger: string;\n};\nexport type ThemePreset = {\n    id: string;\n    name: string;\n    description: string;\n    scheme: 'light' | 'dark';\n    contrast?: 'more';\n    tokens: ThemeTokens;\n    mood?: Readonly<Record<string, number>>;\n};\nexport declare const THEMES: readonly ThemePreset[];\nexport type LookPreset = {\n    id: string;\n    name: string;\n    description: string;\n    vars?: Readonly<Record<string, string>>;\n};\nexport declare const PLAIN_LOOK: LookPreset;\nexport declare const lookVars: (look: LookPreset | undefined) => Record<string, string>;\nexport declare function lookById(id: string | undefined, looks: readonly LookPreset[]): LookPreset | undefined;\nexport type SystemThemes = {\n    light: string;\n    dark: string;\n    contrastLight: string;\n    contrastDark: string;\n};\nexport declare const SYSTEM_THEMES: SystemThemes;\nexport declare const TEXT_SCALES: readonly [\n    100,\n    110,\n    125\n];\nexport type TextScale = (typeof TEXT_SCALES)[number];\nexport type Appearance = {\n    theme: string;\n    look?: string;\n    scale: TextScale;\n    density: 'comfortable' | 'compact';\n    motion: 'system' | 'reduce';\n};\nexport declare const DEFAULT_APPEARANCE: Appearance;\nexport type DeviceSettings = {\n    dark: boolean;\n    moreContrast: boolean;\n    reducedMotion: boolean;\n};\nexport declare function parseAppearance(value: unknown, themes?: readonly ThemePreset[], looks?: readonly LookPreset[]): Appearance;\nexport declare function readAppearance(text: string | null, themes?: readonly ThemePreset[], looks?: readonly LookPreset[]): Appearance;\nexport declare function writeAppearance(appearance: Appearance): string;\nexport declare function themeById(id: string, themes?: readonly ThemePreset[]): ThemePreset | undefined;\nexport declare function resolveTheme(choice: string, device: Pick<DeviceSettings, 'dark' | 'moreContrast'>, themes?: readonly ThemePreset[], system?: SystemThemes): ThemePreset;\nexport declare function motionReduced(appearance: Pick<Appearance, 'motion'>, device: Pick<DeviceSettings, 'reducedMotion'>): boolean;\nexport declare function tokenVar(key: string, prefix?: string): string;\nexport declare function moodNames(themes?: readonly ThemePreset[]): string[];\nexport declare function moodVars(theme: ThemePreset, names: readonly string[], prefix?: string): Record<string, string>;\nexport declare const DENSITY_FACTOR: Record<Appearance['density'], number>;\nexport declare function appearanceStyle(appearance: Appearance, device: DeviceSettings, options?: {\n    themes?: readonly ThemePreset[];\n    system?: SystemThemes;\n    prefix?: string;\n    looks?: readonly LookPreset[];\n}): {\n    theme: ThemePreset;\n    look: LookPreset | null;\n    vars: Record<string, string>;\n    attrs: Record<string, string>;\n    fontSize: string;\n    colorScheme: string;\n};"
        }
      ],
      "pitfalls": [
        "Import appearance.base.css, then appearance.css (or your own look instead)",
        "Pass the same looks to the controller, the form and the boot script",
        "Without the boot script in <head>, a dark theme paints white first",
        "The text scale sets the target’s font-size as a percentage",
        "Stored values are untrusted. readAppearance keeps only known values",
        "The storage event reaches other tabs only, never the one that wrote",
        "document.startViewTransition snapshots the whole page and blocks clicks for the fade",
        "Under Windows high contrast (forced-colors) the system’s colours replace the tokens anyway",
        "Every new token pair a page uses (warning text on the accent, say) needs adding to the audit",
        "propertyFade registers the tokens for the whole page, for good",
        "propertyFade and paletteBlend move colours and moods only",
        "A gliding colour restyles everything under the target on every frame of the fade",
        "paletteBlend writes the tokens itself each frame and stands aside when anything else paints the…",
        "Mood weights are numbers (0 to 1)"
      ],
      "card": "entries/appearance-theme.json"
    },
    {
      "id": "arm-ik",
      "aliases": [],
      "name": "A six-axis arm with analytic IK",
      "summary": "An industrial robot arm that moves like tonnes of servo-driven steel: six joints with a spherical wrist, solved in closed form (the base from the wrist centre’s bearing, shoulder and elbow as a triangle, the wrist from the approach direction), every joint clamped to its limits and the edge of reach eased into. Moves are planned (quintic swings, straight lines solved every step, a brake that carries what was in flight), timed by the slowest joint, and arrive with lag, overshoot, sag under load and a ring-down. Track a moving point or run planned moves, grip, carry and set down. Modelled in code: bevelled castings, servo cans, a gas balancer, a gripper, a torch or a sensor head.",
      "category": "simulation",
      "role": "hero-visual",
      "stack": [
        "three",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "inverse kinematics",
        "analytic ik",
        "closed form",
        "robot arm",
        "six axis",
        "spherical wrist",
        "joint limits",
        "motion planning",
        "quintic",
        "compliance",
        "pick and place",
        "procedural model",
        "three.js",
        "webgpu",
        "rests when idle"
      ],
      "useCases": [
        "a robot cell on a product or factory page",
        "teaching inverse kinematics and joint limits",
        "pick and place, welding or inspection loops in a scene",
        "a machine that points at what you point at",
        "an arm that feels heavy, not floaty"
      ],
      "interaction": "Drag the target (Shift-drag lifts it) · orbit round the cell · Play pick and place",
      "kits": [],
      "pairsWith": [
        {
          "id": "transform-rig",
          "why": "Drag the target the arm follows"
        },
        {
          "id": "camera-director",
          "why": "Framed shots of the robot cell"
        },
        {
          "id": "post-stack",
          "why": "Ambient occlusion and a grade on the castings"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "r187",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 0.347,
          "cpuMs": 0.775,
          "cpuP95Ms": 2.055,
          "badge": "moderate",
          "drawCalls": 78,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 4.785,
            "p99Ms": 8.275,
            "low1Fps": 103.3
          },
          "notes": "The pick-and-place loop with a 420 kg block: planned quintic moves, straight lines solved to joints every 1/180 s step, compliance, sag and settle, shadows from one key light and a room environment; the joint panel written a few times a second."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 2.621,
          "cpuMs": 1.625,
          "cpuP95Ms": 2.28,
          "badge": "heavy",
          "drawCalls": 78,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 467 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 2.114,
          "cpuMs": 0.54,
          "cpuP95Ms": 1.82,
          "badge": "heavy",
          "drawCalls": 78,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 1413 ms."
        }
      ],
      "signatures": [
        {
          "file": "arm-kinematics.ts",
          "declarations": "export type Vec = {\n    x: number;\n    y: number;\n    z: number;\n};\nexport declare const D: {\n    readonly d1: 112;\n    readonly a1: 50;\n    readonly L1: 148;\n    readonly a3: 22;\n    readonly L2: 134;\n    readonly d6: 30;\n    readonly REACH: 334;\n    readonly tool: {\n        readonly gripper: 45;\n        readonly torch: 60;\n        readonly head: 36;\n    };\n};\nexport type Tool = keyof typeof D.tool;\nexport declare const N = 6;\nexport declare const LO: readonly [\n    -3.05,\n    0.09,\n    -2.62,\n    -3.4,\n    -2.2,\n    -6.3\n];\nexport declare const HI: readonly [\n    3.05,\n    2.44,\n    -0.38,\n    3.4,\n    2.2,\n    6.3\n];\nexport declare const VMAX: readonly [\n    1.5,\n    1.3,\n    1.7,\n    3.6,\n    3.8,\n    5.5\n];\nexport declare const AMAX: readonly [\n    2.6,\n    2.2,\n    3.2,\n    11,\n    12,\n    18\n];\nexport declare const JOINT_NAMES: readonly [\n    \"Base\",\n    \"Shoulder\",\n    \"Elbow\",\n    \"Forearm roll\",\n    \"Wrist pitch\",\n    \"Flange roll\"\n];\nexport declare const L2E: number;\nexport declare const GAM: number;\nexport declare const DMAX: number;\nexport declare const KNEE: number;\nexport declare const near: (a: number, ref: number) => number;\nexport type ArmContext = {\n    yaw: number;\n    toolLen: number;\n    head: boolean;\n    G: Vec;\n};\nexport type Solution = {\n    q: Float64Array;\n    reach: number;\n    clamped: boolean[];\n};\nexport declare function solve(out: Float64Array, p: Vec, a: Vec, roll: number | null, ref: ArrayLike<number>, ctx: ArmContext, info?: {\n    reach: number;\n    clamped: boolean[];\n}): Float64Array;\nexport declare function fk(t: ArrayLike<number>, toolLen: number): Vec;\nexport declare function approachOf(t: ArrayLike<number>): Vec;\nexport declare function limitMargins(q: ArrayLike<number>, yaw?: number): number[];"
        },
        {
          "file": "arm-parts.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { type Tool } from './arm-kinematics';\nexport declare const BAL: {\n    cx: number;\n    cy: number;\n    px: number;\n    py: number;\n};\nexport declare const JAW: {\n    open: number;\n    shut: number;\n};\nexport type ArmMaterials = Record<'steel' | 'iron' | 'dark' | 'paint' | 'paint2' | 'rubber', THREE.MeshStandardMaterial>;\nexport declare function createArmMaterials(): ArmMaterials;\nexport declare const ARM_PALETTES: {\n    dark: {\n        steel: number;\n        iron: number;\n        dark: number;\n        paint: number;\n        paint2: number;\n        rubber: number;\n    };\n    light: {\n        steel: number;\n        iron: number;\n        dark: number;\n        paint: number;\n        paint2: number;\n        rubber: number;\n    };\n};\nexport declare function themeArmMaterials(m: ArmMaterials, name: keyof typeof ARM_PALETTES): void;\nexport type ArmLook = {\n    tool: Tool;\n    unit: string;\n    colour: 'paint' | 'paint2' | 'dark';\n    eye?: number;\n};\nexport type ArmRig = {\n    root: THREE.Group;\n    rock: THREE.Group;\n    j: THREE.Group[];\n    flange: THREE.Group;\n    tcp: THREE.Group;\n    bal: THREE.Group;\n    rod: THREE.Group;\n    jaws: THREE.Group[];\n    glow: THREE.Mesh;\n    own: {\n        lamp: THREE.MeshStandardMaterial;\n        eye: THREE.MeshStandardMaterial;\n        tip: THREE.MeshStandardMaterial;\n        glow: THREE.MeshBasicMaterial;\n        num: THREE.MeshStandardMaterial;\n    };\n    toolLen: number;\n    free(): void;\n};\nexport declare function buildArm(o: ArmLook, M: ArmMaterials): ArmRig;\nexport declare function disposeArmGeometry(): void;"
        },
        {
          "file": "arm.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { type Tool } from './arm-kinematics';\nimport { type ArmMaterials } from './arm-parts';\nexport type ArmOptions = {\n    x?: number;\n    y?: number;\n    z?: number;\n    reach?: number;\n    yaw?: number;\n    tool?: Tool;\n    mount?: 'floor' | 'ceiling' | 'wall';\n    colour?: 'paint' | 'paint2' | 'dark';\n    unit?: string;\n    capacity?: number;\n    stiff?: number;\n    hunt?: number;\n    eye?: number;\n    onThud?: (mass: number, tip: THREE.Vector3) => void;\n};\nexport type MoveOptions = {\n    speed?: number;\n    via?: THREE.Vector3 | THREE.Vector3[];\n    settle?: boolean;\n    approach?: THREE.Vector3;\n    roll?: number | null;\n    linear?: boolean;\n    done?: () => void;\n};\nexport type Arm = ReturnType<typeof createArm>;\nexport declare function createArm(parent: THREE.Object3D, materials: ArmMaterials, opts?: ArmOptions): {\n    root: THREE.Group<THREE.Object3DEventMap>;\n    tip: THREE.Vector3;\n    step: (dt: number) => boolean;\n    moveTo: (point: THREE.Vector3, opt?: MoveOptions) => Promise<boolean>;\n    moveJ: (target: ArrayLike<number>, opt?: MoveOptions) => Promise<boolean>;\n    follow: (point: THREE.Vector3 | null, opt?: {\n        approach?: THREE.Vector3;\n        roll?: number | null;\n        watch?: boolean;\n    }) => void;\n    park: (opt?: MoveOptions) => Promise<boolean>;\n    snap: (target?: ArrayLike<number>) => void;\n    refresh: () => void;\n    unit: string;\n    reach: number;\n    tool: \"head\" | \"gripper\" | \"torch\";\n    yaw: number;\n    home: (opt?: MoveOptions) => Promise<boolean>;\n    solve: (p: THREE.Vector3, opt?: {\n        approach?: THREE.Vector3;\n        roll?: number | null;\n    }) => number[];\n    grip(closed: number, width?: number): Promise<boolean>;\n    attach(obj: THREE.Object3D, mass?: number): THREE.Object3D<THREE.Object3DEventMap>;\n    release(to?: THREE.Object3D): THREE.Object3D<THREE.Object3DEventMap> | null;\n    weld(on: boolean): void;\n    dispose(): void;\n    readonly busy: boolean;\n    readonly moving: boolean;\n    readonly alive: boolean;\n    load: number;\n    readonly effort: number;\n    stiff: number;\n    readonly lean: number[];\n    readonly arc: number;\n    readonly dark: boolean;\n    readonly joints: number[];\n    readonly reachShare: number;\n    readonly clamped: boolean[];\n    readonly carried: THREE.Object3D<THREE.Object3DEventMap> | null;\n};"
        }
      ],
      "pitfalls": [
        "Pass the present joints as ref to every solve",
        "A wrist straight in line (J5 near 0) is a singularity",
        "Points past a joint limit or the reach are not refused",
        "World units are the arm’s",
        "step(dt) runs fixed 1/180 s sub-steps",
        "A move’s promise resolves only once the ringing has died (settle) unless settle",
        "Set the load (attach(obj, mass)) before moving off with it",
        "The arm is never quite still while the servos hunt",
        "The geometry is built once and shared by every arm on the page"
      ],
      "card": "entries/arm-ik.json"
    },
    {
      "id": "arrange-in-place",
      "aliases": [],
      "name": "Arrange any page in place",
      "summary": "Move, resize, hide, line up and spread the parts of any live HTML page, like shapes on a slide: smart guides and equal gaps, several at once, the keyboard too, and undo. Each part is found again by the nearest data-edit or data-item and a child path, so edits survive re-renders; offsets ride on CSS translate and scale in a unit you pick, so entrances still play; the whole arrangement is a small JSON the page re-applies.",
      "category": "ui",
      "role": "interaction",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "arrange",
        "drag",
        "resize",
        "smart guides",
        "snapping",
        "equal spacing",
        "align",
        "distribute",
        "multi-select",
        "undo",
        "keyboard",
        "live region",
        "css translate",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "slide and deck editors",
        "tweaking a generated or templated page by hand",
        "landing page and email builders",
        "dashboards people lay out themselves",
        "design reviews on the live page"
      ],
      "interaction": "Drag anything on the page · corners resize, sides set the width · Shift or Ctrl adds · arrows nudge · M turns arranging off",
      "kits": [],
      "pairsWith": [
        {
          "id": "smart-guides",
          "why": "The same snapping and equal-gap geometry"
        },
        {
          "id": "labelled-undo",
          "why": "Undo steps named by what moved"
        },
        {
          "id": "beside-placement",
          "why": "Its inspector sits beside the part, never over it"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": null,
          "cpuMs": 0.35,
          "cpuP95Ms": 0.78,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the demo arranging by itself: synthetic pointer events press a feature card, carry it in a slow loop for 48 frames (every frame places it, snaps it to its neighbours’ edges, middles and equal gaps, and moves the guides and handles) and drop it, then rest 12 frames, going round the three cards. Nothing runs between changes."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.815,
          "cpuP95Ms": 2.01,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 74 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.77,
          "cpuP95Ms": 2.94,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 131 ms."
        }
      ],
      "signatures": [
        {
          "file": "apply.ts",
          "declarations": "import { type Arrangement, type Placement } from './arrangement';\nexport type Unit = {\n    css: string;\n    px(el: Element): number;\n};\nexport declare const pxUnit: Unit;\nexport declare const viewportUnit: (axis?: \"vw\" | \"vh\") => Unit;\nexport declare const remUnit: Unit;\nexport declare const varUnit: (name: string) => Unit;\nexport type ArrangeEl = HTMLElement | SVGElement;\nexport declare const DEFAULT_ANCHORS: readonly string[];\nexport type ApplyOptions = {\n    unit?: Unit;\n    anchors?: readonly string[];\n};\nexport declare const PLACED = \"data-aip-placed\";\nexport declare const HIDDEN = \"data-aip-hidden\";\nexport declare function placeElement(el: ArrangeEl, p: Placement | null | undefined, unit?: Unit): void;\nexport declare function applyArrangement(root: HTMLElement, a: Arrangement | null | undefined, o?: ApplyOptions): number;\nexport declare function keyOf(el: Element, root: HTMLElement, anchors?: readonly string[]): string;\nexport declare function findByKey(root: HTMLElement, key: string, anchors?: readonly string[]): ArrangeEl | null;\nexport declare function ancestorScale(el: Element): number;"
        },
        {
          "file": "arrange-in-place.ts",
          "declarations": "import { type Arrangement } from './arrangement';\nimport type { AlignMode } from './arrange';\nimport { type ArrangeEl, type Unit } from './apply';\nexport type ArrangeChange = {\n    label: string;\n    keys: string[];\n};\nexport type ArrangeOptions = {\n    arrangement?: Arrangement;\n    unit?: Unit;\n    anchors?: readonly string[];\n    whole?: string;\n    skip?: string;\n    layer?: HTMLElement;\n    on?: boolean;\n    snap?: boolean;\n    spacing?: boolean;\n    reach?: number;\n    nudge?: number;\n    bigNudge?: number;\n    watch?: boolean;\n    name?: (el: ArrangeEl) => string;\n    onChange?: (arrangement: Arrangement, change: ArrangeChange) => void;\n    onSelect?: (elements: ArrangeEl[]) => void;\n    onToggle?: (on: boolean) => void;\n    announce?: boolean | ((text: string) => void);\n    messages?: Partial<ArrangeMessages>;\n};\nexport type ArrangeMessages = typeof MESSAGES;\nexport declare const MESSAGES: {\n    area: string;\n    help: string;\n    toolbar: string;\n    picked: (name: string, at: number, of: number) => string;\n    pickedMany: (n: number) => string;\n    selected: (n: number) => string;\n    done: (label: string, who: string) => string;\n    undid: (label: string) => string;\n    redid: (label: string) => string;\n    nothingInside: string;\n    nothingAround: string;\n    items: (n: number) => string;\n    lineUpMany: (what: string) => string;\n    lineUpOne: (what: string) => string;\n    spreadX: string;\n    spreadY: string;\n    sameWidth: string;\n    bigger: string;\n    hide: string;\n    show: string;\n    reset: string;\n    labels: {\n        move: string;\n        scale: string;\n        width: string;\n        align: string;\n        spread: string;\n        same: string;\n        hide: string;\n        show: string;\n        reset: string;\n        resetAll: string;\n        load: string;\n        nudge: string;\n    };\n};\nexport type ArrangeController = {\n    readonly root: HTMLElement;\n    readonly on: boolean;\n    setOn(on: boolean): void;\n    get(): Arrangement;\n    set(a: Arrangement, fresh?: boolean): void;\n    apply(): void;\n    refresh(): void;\n    readonly selection: ArrangeEl[];\n    select(elements: ArrangeEl[]): void;\n    align(mode: AlignMode): void;\n    spread(axis: 'x' | 'y'): void;\n    matchWidth(): void;\n    toggleHidden(): void;\n    reset(): void;\n    resetAll(): void;\n    undo(): void;\n    redo(): void;\n    readonly canUndo: boolean;\n    readonly canRedo: boolean;\n    dispose(): void;\n};\nexport declare function arrangeInPlace(root: HTMLElement, options?: ArrangeOptions): ArrangeController;\nexport declare function defaultName(el: ArrangeEl): string;"
        }
      ],
      "pitfalls": [
        "Import arrange-in-place.base.css (and the look, or your own)",
        "Mark the parts you edit with data-edit or data-item (or pass your own anchors)",
        "Two elements with the same anchor value are told apart by their order",
        "Offsets are on CSS translate and scale, composed with the design’s own",
        "Pick a unit that scales the way the page does",
        "Moves divide by the scale of every box around the part (transform, scale, zoom)",
        "While arranging the root swallows clicks and takes its focusable parts out of the Tab order",
        "A framework that rewrites a placed element’s inline style",
        "A hidden part is visibility"
      ],
      "card": "entries/arrange-in-place.json"
    },
    {
      "id": "arrival-shockwave",
      "aliases": [],
      "name": "Lightspeed and shockwave",
      "summary": "A title moment for a stage or a launch: the camera races in at lightspeed behind falling lights, the stars streaking past, brakes hard into their trails and watches them strike an unseen barrier round a world: a flash, a shell of light, a ring running over the barrier’s cells, sparks skittering off it. Then the camera draws back and a word comes up under the world. Raw WebGPU, driven by plain 0..1 numbers or a built-in 16-second sequence; a scrub lands on any moment.",
      "category": "particles",
      "role": "hero-visual",
      "stack": [
        "webgpu"
      ],
      "character": "expressive",
      "tags": [
        "lightspeed",
        "warp",
        "shockwave",
        "force field",
        "motion blur",
        "streaks",
        "ray tracing",
        "voronoi",
        "wgsl",
        "raw webgpu",
        "title sequence",
        "deterministic"
      ],
      "useCases": [
        "opening a talk, a keynote or a live stream",
        "intro and title sequences",
        "splash and launch screens",
        "arrivals, jumps and impacts in games",
        "loading moments that end on a word"
      ],
      "interaction": "Click or press Enter to replay · arrow keys to scrub",
      "kits": [
        {
          "kit": "product-presentation",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "audio-engine",
          "why": "A boom cued on the frame the shell hits"
        },
        {
          "id": "slide-transitions",
          "why": "From the title moment into the first slide"
        },
        {
          "id": "names-wall",
          "why": "Another title moment for the same show"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [
        {
          "name": "shake",
          "in": "module",
          "values": {
            "strict": 0,
            "refined": 0.4,
            "playful": 1
          },
          "note": "the shake on impact: 0 none, 1 as made"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 5.558,
          "cpuMs": 0.145,
          "cpuP95Ms": 0.24,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "The whole 16 s sequence played over and over at medium quality (12k stars, 2 × 2,600 trail particles, 2 × 700 sparks): one full-screen ray-traced pass (world, barrier cells, shockwaves, word), the stars as streaks and the particles additive, one composite pass; timed with its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.769,
          "cpuMs": 0.32,
          "cpuP95Ms": 0.505,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 384 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 6.516,
          "cpuMs": 0.28,
          "cpuP95Ms": 0.4,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 412 ms."
        }
      ],
      "signatures": [
        {
          "file": "arrival.ts",
          "declarations": "import { type ArrivalMoment } from './choreography';\nimport { type World, type WorldOptions } from './plan';\nimport { type WordFont } from './word';\nexport type Quality = 'low' | 'medium' | 'high';\nexport declare const QUALITY: Record<Quality, {\n    stars: number;\n    trail: number;\n    sparks: number;\n}>;\nexport type ArrivalColours = {\n    top: string;\n    bottom: string;\n    glow: string;\n    accent: string;\n    ink: string;\n    line: string;\n    lights: string;\n    sun: string;\n};\nexport declare const DEFAULT_COLOURS: ArrivalColours;\nexport type ArrivalOptions = {\n    device?: GPUDevice;\n    quality?: Quality;\n    world?: WorldOptions;\n    colours?: Partial<ArrivalColours>;\n    word?: string;\n    line?: string;\n    font?: WordFont;\n    planet?: boolean;\n    clouds?: number;\n    cityLights?: number;\n};\nexport type ArrivalShockwave = {\n    readonly device: GPUDevice;\n    readonly world: World;\n    draw(now: ArrivalMoment, before?: ArrivalMoment): boolean;\n    drawAt(t: number): boolean;\n    ready(times?: number[]): Promise<void>;\n    setWord(word: string, line?: string, font?: WordFont): void;\n    setColours(colours: Partial<ArrivalColours>): void;\n    setQuality(quality: Quality): void;\n    setWorld(options: WorldOptions): void;\n    setPlanet(on: boolean): void;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare function createArrivalShockwave(canvas: HTMLCanvasElement, options?: ArrivalOptions): Promise<ArrivalShockwave | null>;"
        },
        {
          "file": "choreography.ts",
          "declarations": "export type ArrivalMoment = {\n    clock: number;\n    fly: number;\n    fall: number;\n    ride: number;\n    warp: number;\n    brake: number;\n    settle: number;\n    impact: number;\n    shield: number;\n    reveal: number;\n    sweep: number;\n    line: number;\n    flash: number;\n    exposure: number;\n    speed: number;\n};\nexport declare function createMoment(): ArrivalMoment;\ntype Ease = 'linear' | 'in' | 'out' | 'inOut';\nexport declare const FALL = 90;\nexport declare const IMPACT_AT = 10;\nexport declare const ARRIVAL_SECONDS = 16;\nexport declare const ARRIVAL_SCENES: ReadonlyArray<{\n    at: number;\n    name: string;\n}>;\nexport declare function sceneAt(t: number): string;\nexport declare function ease(kind: Ease, x: number): number;\nexport declare function arrivalAt(t: number, out?: ArrivalMoment): ArrivalMoment;\nexport declare function shutterAt(t: number): number;\nexport declare function calmArrivalAt(t: number, out?: ArrivalMoment): ArrivalMoment;\nexport {};"
        },
        {
          "file": "still.ts",
          "declarations": "import { type World } from './plan';\nimport { type WordFont } from './word';\nimport { type ArrivalColours } from './arrival';\nexport type StillOptions = {\n    world?: World;\n    colours?: Partial<ArrivalColours>;\n    word?: string;\n    line?: string;\n    font?: WordFont;\n    planet?: boolean;\n};\nexport declare function drawArrivalStill(g: CanvasRenderingContext2D, o?: StillOptions): void;"
        }
      ],
      "pitfalls": [
        "The stars streak only if you pass the moment a shutter ago",
        "Draw at the canvas’s own width and height",
        "Await document.fonts.ready before creating it (or call setWord again once the font loads)",
        "Past the end the last moment holds alive only while you keep drawing with a running clock",
        "draw() skips while the last frame is still on the GPU (never more than one queued)",
        "arrivalAt(t) is the built-in sequence in seconds",
        "Without WebGPU createArrivalShockwave returns null"
      ],
      "card": "entries/arrival-shockwave.json"
    },
    {
      "id": "attribution-garden",
      "aliases": [],
      "name": "Marketing attribution garden",
      "summary": "Marketing attribution you can watch. A month of customer journeys plays as a garden: each customer is a bee flying its own path through flower beds (the channels), dusted with each channel’s pollen at every touch; a sale becomes a fruit on that day’s column of the wall, its drupelets the pollen shared out by the model you pick, and a journey that never buys drops its pollen as dust by the last bed. Five models (last click, first click, linear, time decay, and a Markov chain with each channel’s removal effect), pure and tested; cutting a budget re-solves the chain, wilts the bed and takes its sales off the wall. Every bee and grain is a closed-form function of its journey and the clock, so scrubbing the month redraws it exactly. A second view pours each channel’s credit into five jars, a grain a half sale, so their levels are the counts. Raw WebGPU, drawn on demand; a Canvas 2D garden where WebGPU is missing.",
      "category": "data",
      "role": "hero-visual",
      "stack": [
        "webgpu"
      ],
      "character": "expressive",
      "tags": [
        "attribution",
        "marketing",
        "markov chain",
        "removal effect",
        "last click",
        "first click",
        "time decay",
        "budget",
        "what-if",
        "customer journeys",
        "stateless",
        "scrubbable",
        "closed form",
        "instancing",
        "compute",
        "raw webgpu",
        "wgsl",
        "canvas 2d fallback",
        "draw on demand",
        "timestamp queries",
        "seeded",
        "no dependencies"
      ],
      "useCases": [
        "showing a team why last-click reports undersell the channels that introduce customers",
        "a what-if for a budget cut: sales and revenue lost, and spend saved per sale lost",
        "comparing attribution models side by side over the same journeys",
        "replaying any event log of paths and outcomes (support tickets, onboarding steps, a sales funnel) as particles that can be scrubbed",
        "teaching Markov removal effects with a chain you can solve by hand in the tests"
      ],
      "interaction": "Pick a model · drag the month strip to scrub · cut a budget · point at a fruit or a bed · follow one customer",
      "kits": [],
      "pairsWith": [
        {
          "id": "chart-access",
          "why": "The numbers behind the garden as a table"
        },
        {
          "id": "sankey-flows",
          "why": "The same journeys as plain flows"
        },
        {
          "id": "date-picker",
          "why": "Pick the month the garden plays"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [
        {
          "name": "calm",
          "in": "module",
          "values": {
            "strict": true
          },
          "note": "wings still, pours settled"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-14",
          "gpuMs": 3.304,
          "cpuMs": 0.785,
          "cpuP95Ms": 1.225,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured replaying the month at 3× from day 8 with 12,000 journeys: one compute dispatch evaluates every bee’s closed-form path, then about 90,000 pollen grains, the fruit and the beds are drawn as instanced quads; timed by its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.835,
          "cpuMs": 0.97,
          "cpuP95Ms": 1.55,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 106 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 10.074,
          "cpuMs": 1.82,
          "cpuP95Ms": 2.04,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 189 ms."
        }
      ],
      "signatures": [
        {
          "file": "attribution.ts",
          "declarations": "export type Journey = {\n    id: number;\n    c: number[];\n    t: number[];\n    conv: boolean;\n    tc: number;\n    rev: number;\n};\nexport type ModelInfo = {\n    id: 'last' | 'first' | 'linear' | 'decay' | 'markov';\n    name: string;\n    short: string;\n    says: string;\n};\nexport declare const MODELS: ModelInfo[];\nexport declare const NM: number;\nexport declare function hash01(n: number): number;\nexport type Chain = {\n    n: number;\n    P: Float64Array[];\n};\nexport declare function buildChain(journeys: readonly Journey[], n: number): Chain;\nexport declare function saleChance(chain: Chain, cut?: ArrayLike<number>): number;\nexport declare function removalEffects(chain: Chain): Float64Array;\nexport declare function creditOf(j: Pick<Journey, 'c' | 't' | 'tc'>, n: number, removal: ArrayLike<number>, halfLife?: number): Float64Array[];\nexport type Attribution = {\n    n: number;\n    chain: Chain;\n    base: number;\n    removal: Float64Array;\n    sales: Journey[];\n    creditOfSale: Map<number, Float64Array[]>;\n    credit: Float64Array[];\n    creditRev: Float64Array[];\n    total: {\n        journeys: number;\n        sales: number;\n        revenue: number;\n    };\n    halfLife: number;\n};\nexport declare function attribute(journeys: readonly Journey[], n: number, { halfLife }?: {\n    halfLife?: number | undefined;\n}): Attribution;\nexport declare const costPerSale: (a: Attribution, spend: ArrayLike<number>, m: number, c: number) => number;\nexport declare const returnOnSpend: (a: Attribution, spend: ArrayLike<number>, m: number, c: number) => number;\nexport type CutEffect = {\n    keep: number;\n    lost: number;\n    lostRev: number;\n    saved: number;\n    perSale: number;\n};\nexport declare function cutEffect(a: Attribution, cuts: ArrayLike<number>, spend: ArrayLike<number>): CutEffect;\nexport type CutJourney = {\n    j: Journey;\n    keepT: boolean[];\n    conv: boolean;\n};\nexport declare function applyCuts(journeys: readonly Journey[], cuts: ArrayLike<number>, lost: number, seed?: number): CutJourney[];\nexport type PathCount = {\n    c: number[];\n    n: number;\n    sales: number;\n    rev: number;\n};\nexport declare function topPaths(journeys: readonly Journey[], count?: number): PathCount[];\nexport declare function salesPerDay(journeys: readonly Journey[], days: number): Float64Array;"
        },
        {
          "file": "garden-plan.ts",
          "declarations": "import { type Attribution, type CutJourney } from './attribution';\nexport declare const WORLD: {\n    readonly w: 1000;\n    readonly h: 600;\n};\nexport declare const worldWidthFor: (w: number, h: number) => number;\nexport declare const MAX_CHANNELS = 8;\nexport declare const MAX_TOUCH = 8;\nexport declare const GRAINS_PER_TOUCH = 3;\nexport declare const TIMING: {\n    readonly lead: 0.35;\n    readonly leave: 0.45;\n    readonly dwell: 0.06;\n    readonly transit: 0.3;\n    readonly toFruit: 0.3;\n    readonly puff: 0.08;\n    readonly swirl: 0.12;\n    readonly fall: 0.3;\n    readonly fade: 7;\n};\nexport declare const WALL_TOP = 362;\nexport declare const WALL_BASE = 574;\nexport declare const WALL_X0 = 40;\nexport type Bed = {\n    x: number;\n    y: number;\n    r: number;\n};\nexport type Fruit = {\n    x: number;\n    y: number;\n    day: number;\n    j: number;\n    tc: number;\n    arrive: number;\n    credit: Float64Array[];\n    kept: number[];\n};\nexport type Plan = {\n    n: number;\n    days: number;\n    width: number;\n    beds: Bed[];\n    blooms: Float32Array<ArrayBuffer>;\n    wall: {\n        colW: number;\n        fruit: number;\n        step: number;\n        row: number;\n        across: number;\n    };\n    rows: CutJourney[];\n    jData: Float32Array<ArrayBuffer>;\n    fruits: Fruit[];\n    fData: Float32Array<ArrayBuffer>;\n    grains: Uint32Array<ArrayBuffer>;\n    arrivals: Float64Array;\n    revenueCum: Float64Array;\n    beeIn: Float64Array;\n    beeOut: Float64Array;\n    touchTimes: Float64Array[];\n};\nexport declare const J_VEC = 6;\nexport declare const F_VEC: number;\nexport declare const BLOOM_FLOATS = 8;\nexport declare function h1(n: number): number;\nexport declare function bedsFor(spend: ArrayLike<number>, width?: number): Bed[];\nexport declare const bloomOf: (j: number, i: number, ch: number) => number;\nexport declare function buildPlan(a: Attribution, rows: CutJourney[], spend: ArrayLike<number>, days: number, { width }?: {\n    width?: number | undefined;\n}): Plan;\nexport declare function countAtMost(sorted: ArrayLike<number>, x: number): number;\nexport declare function salesBy(plan: Plan, t: number): {\n    sales: number;\n    revenue: number;\n};\nexport declare const beesAt: (plan: Plan, t: number) => number;\nexport declare function glowAt(plan: Plan, t: number, win: number, norm: number): number[];\ntype V2 = [\n    number,\n    number\n];\nexport declare function beeAt(p: Plan, j: number, t: number): {\n    x: number;\n    y: number;\n    show: number;\n};\nexport declare function beeHeading(p: Plan, j: number, t: number): V2;\nexport declare function dustLand(p: Plan, j: number, k: number, ch: number): V2;\nexport declare function grainAt(p: Plan, j: number, i: number, k: number, t: number): {\n    x: number;\n    y: number;\n    size: number;\n    alpha: number;\n    settled: boolean;\n} | null;\nexport declare function fruitScale(f: Pick<Fruit, 'arrive'>, t: number): number;\nexport type Jar = {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n    ch: number;\n    model: number;\n    grains: number;\n    perRow: number;\n    level: number;\n};\nexport declare function jarLayout(rect: {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n}, credit: Float64Array[], perGrain: number, { neck }?: {\n    neck?: number | undefined;\n}): {\n    jars: Jar[];\n    d: number;\n};\nexport declare const jarLevel: (grains: number, perRow: number, d: number) => number;\nexport declare function grainInJar(jar: Jar, slot: number, d: number): V2;\nexport {};"
        },
        {
          "file": "garden.ts",
          "declarations": "import { type Jar, type Plan } from './garden-plan';\nexport type GardenFrame = {\n    mode: 'garden' | 'jars';\n    t: number;\n    view: {\n        ox: number;\n        oy: number;\n        s: number;\n    };\n    model: {\n        from: number;\n        to: number;\n        mix: number;\n    };\n    focus?: number;\n    hoverFruit?: number;\n    hoverBed?: number;\n    health: ArrayLike<number>;\n    glow: ArrayLike<number>;\n    night: number;\n    calm?: boolean;\n    clock: number;\n    jars?: {\n        pourAt: number;\n        modelAt: number;\n        hover: number;\n        shelf: [\n            y: number,\n            x0: number,\n            x1: number\n        ];\n    };\n};\nexport type AttributionGarden = {\n    setPlan(plan: Plan, opts?: {\n        startDow?: number;\n        busy?: [\n            number,\n            number\n        ];\n    }): void;\n    setJars(jars: Jar[], d: number): void;\n    draw(frame: GardenFrame): boolean;\n    readonly lost: boolean;\n    onLost: ((reason: string) => void) | null;\n    pixelRatio: number;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare function createAttributionGarden(canvas: HTMLCanvasElement): Promise<AttributionGarden | null>;"
        }
      ],
      "pitfalls": [
        "Scrubbing is exact only because nothing is carried between frames",
        "The bee paths exist twice, in garden-plan.ts (beeAt, grainAt) and in the WGSL (beeAt)",
        "A sale’s fruit is set when its bee arrives, which can be a little after the sale",
        "Short gaps make fast flights",
        "The Markov chain is solved exactly (a (channels + 1)-square linear system)",
        "Removal effects are shares of all sales, so they sum to more than 1",
        "applyCuts plays a cut as whole channels dropped from journeys by a fixed draw",
        "The fruit read the credit of every model from storage and mix two of them in the vertex shader",
        "Grains on a bee are drawn where the compute pass put the bee this frame",
        "Pipelines take about 3 s to build on a cold shader cache (longer on a busy GPU)",
        "Without WebGPU the Canvas 2D garden walks every journey on the CPU each painted frame",
        "A lost device (a driver reset, a sleeping laptop) sets lost and calls onLost",
        "draw() returns false while the last frame is still on the GPU"
      ],
      "card": "entries/attribution-garden.json"
    },
    {
      "id": "audience-vote",
      "aliases": [],
      "name": "Audience vote",
      "summary": "The room votes on their phones and the stage shows a live tally (bars or a ring) and an awards-style reveal: nominee cards, a drum roll, the winner, ties handled. Votes come from a hosted room (a WebSocket that reconnects), a simulated crowd for rehearsals, or the operator’s own numbers, and the show switches between them without the stage noticing. A QR encoder written from the standard, a tiny accessible phone page, and a reference Cloudflare Worker with a Durable Object per room: operator keys, rate limits, one vote per device, deletion after the event. Plain DOM, no dependencies.",
      "category": "systems",
      "role": "system",
      "stack": [
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "voting",
        "polls",
        "live tally",
        "reveal",
        "awards",
        "QR code",
        "WebSocket",
        "reconnect",
        "Cloudflare Workers",
        "Durable Objects",
        "hibernation",
        "rate limiting",
        "privacy",
        "presentation",
        "show",
        "operator console",
        "live region",
        "accessibility",
        "keyboard",
        "touch",
        "rtl",
        "dom",
        "css",
        "no dependencies"
      ],
      "useCases": [
        "an audience picks what the presenters show next",
        "awards and \"people’s choice\" reveals",
        "live polls in a talk or a meeting",
        "rehearsing a show without a network",
        "a QR code for any short link",
        "a small anonymous vote server for an event"
      ],
      "interaction": "Vote on the phone, run a round from the console or with Run a round · Make it a tie, drop the network · nothing leaves your browser",
      "kits": [],
      "pairsWith": [
        {
          "id": "cue-console",
          "why": "Open and reveal the vote from the cue list"
        },
        {
          "id": "lan-remote",
          "why": "Pair phones in the room without a cloud"
        },
        {
          "id": "fireworks",
          "why": "Celebrate the winner on the reveal"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 0.035,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the demo running rounds on its own: the simulated crowd stepped every frame (240 voters over about four seconds), the tally rewritten once a frame, voting closed and the reveal played (nominees, drum roll, winner) at four times speed, then the next round. The in-page room server and the phone run alongside. Nothing runs between changes outside the bench."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.015,
          "cpuP95Ms": 0.08,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 79 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.02,
          "cpuP95Ms": 0.12,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 146 ms."
        }
      ],
      "signatures": [
        {
          "file": "console.ts",
          "declarations": "import type { Link, SourceKind, VoteDesk } from './sources';\nexport declare const CONSOLE_LABELS: {\n    region: string;\n    source: string;\n    kinds: Record<SourceKind, string>;\n    links: Record<Link, string>;\n    lastUpdate: (time: string) => string;\n    noUpdate: string;\n    phones: (n: string, count: number) => string;\n    phase: {\n        draft: string;\n        open: string;\n        closed: string;\n        revealed: string;\n    };\n    open: string;\n    reopen: string;\n    close: string;\n    reveal: string;\n    reset: string;\n    count: (title: string) => string;\n    less: (title: string) => string;\n    more: (title: string) => string;\n    crown: string;\n    crownFor: (title: string) => string;\n    tie: (names: string) => string;\n    shareWin: string;\n    and: string;\n    total: (n: string) => string;\n    saidSource: (kind: string) => string;\n    saidLink: (kind: string, link: string) => string;\n};\nexport type ConsoleOptions = {\n    locale?: string;\n    labels?: Partial<typeof CONSOLE_LABELS>;\n    time?: (ms: number) => string;\n};\nexport type VoteConsole = {\n    element: HTMLElement;\n    destroy(): void;\n};\nexport declare function createVoteConsole(host: HTMLElement, desk: VoteDesk, options?: ConsoleOptions): VoteConsole;"
        },
        {
          "file": "qr.ts",
          "declarations": "export type Ecc = 'L' | 'M' | 'Q' | 'H';\nexport type QrCode = {\n    readonly version: number;\n    readonly ecc: Ecc;\n    readonly mask: number;\n    readonly size: number;\n    readonly modules: Uint8Array;\n};\nexport type QrOptions = {\n    ecc?: Ecc;\n    boost?: boolean;\n    minVersion?: number;\n    mask?: number;\n};\nexport declare const MAX_VERSION = 10;\nexport declare const blocksOf: (version: number, ecc: Ecc) => readonly [\n    number,\n    number,\n    number,\n    number\n];\nexport declare function dataCodewords(version: number, ecc: Ecc): number;\nexport declare const byteCapacity: (version: number, ecc: Ecc) => number;\nexport declare const gfMul: (a: number, b: number) => number;\nexport declare const gfPow: (n: number) => number;\nexport declare function generator(n: number): Uint8Array;\nexport declare function errorCorrection(data: ArrayLike<number>, n: number): Uint8Array;\nexport declare function dataBits(bytes: Uint8Array, version: number, ecc: Ecc): Uint8Array;\nexport declare function interleave(data: Uint8Array, version: number, ecc: Ecc): Uint8Array;\nexport declare const formatBits: (ecc: Ecc, mask: number) => number;\nexport declare const versionBits: (version: number) => number;\nexport declare const MASKS: ReadonlyArray<(i: number, j: number) => boolean>;\ntype Grid = {\n    size: number;\n    dark: Uint8Array;\n    fixed: Uint8Array;\n};\nexport declare function functionPatterns(version: number): Grid;\nexport declare function placeData(g: Grid, codewords: Uint8Array): void;\nexport declare function penalty(size: number, dark: Uint8Array): number;\nexport declare function encodeQr(text: string, options?: QrOptions): QrCode;\nexport declare function qrPath(qr: QrCode, margin?: number): string;\nexport type SvgOptions = {\n    margin?: number;\n    dark?: string;\n    light?: string;\n    label?: string;\n};\nexport declare function qrSvg(qr: QrCode, o?: SvgOptions): string;\nexport {};"
        },
        {
          "file": "sources.ts",
          "declarations": "import { type Counts } from './protocol';\nimport { type SocketFactory, type Timers } from './socket';\nimport { type Round, type TiePolicy, type VoteState } from './vote-model';\nexport type { SocketFactory, SocketLike, Timers } from './socket';\nexport type SourceKind = 'manual' | 'simulated' | 'hosted';\nexport type Link = 'idle' | 'connecting' | 'live' | 'reconnecting' | 'offline' | 'refused';\nexport type SourceStatus = {\n    kind: SourceKind;\n    link: Link;\n    lastUpdate: number | null;\n    phones?: number;\n    detail?: string;\n};\nexport type SourceUpdate = {\n    counts: Counts;\n    voters?: number;\n};\nexport type Sink = {\n    update(u: SourceUpdate): void;\n    status(s: SourceStatus): void;\n};\nexport interface VoteSource {\n    readonly kind: SourceKind;\n    attach(sink: Sink): void;\n    open(round: Round): void;\n    close(round: Round): void;\n    reveal(round: Round, winners: readonly string[], counts: Counts): void;\n    status(): SourceStatus;\n    destroy(): void;\n}\nexport type ManualSource = VoteSource & {\n    readonly kind: 'manual';\n    set(counts: Counts, voters?: number): void;\n    add(id: string, n?: number): void;\n    counts(): Counts;\n};\nexport declare function manualSource(): ManualSource;\nexport type SimulatedOptions = {\n    voters?: number;\n    weights?: Record<string, number>;\n    duration?: number;\n    rate?: number;\n    seed?: number;\n    auto?: boolean;\n    timers?: Timers;\n};\nexport type SimulatedSource = VoteSource & {\n    readonly kind: 'simulated';\n    step(seconds: number): void;\n    cast(token: string, option: string): boolean;\n    finish(): void;\n    setOptions(o: Partial<SimulatedOptions>): void;\n};\nexport declare function xorshift(seed: number): () => number;\nexport declare function simulatedSource(options?: SimulatedOptions): SimulatedSource;\nexport type HostedOptions = {\n    url: string;\n    key: string;\n    socket?: SocketFactory;\n    retry?: {\n        min: number;\n        max: number;\n    };\n    heartbeat?: number;\n    timers?: Timers;\n    random?: () => number;\n};\nexport type HostedSource = VoteSource & {\n    readonly kind: 'hosted';\n    connect(): void;\n    disconnect(): void;\n    end(): void;\n};\nexport declare function hostedSource(options: HostedOptions): HostedSource;\nexport type AnySource = ManualSource | SimulatedSource | HostedSource;\nexport type DeskSnapshot = {\n    state: VoteState;\n    active: SourceKind;\n    sources: SourceStatus[];\n    tie: boolean;\n};\nexport type DeskOptions = {\n    sources: VoteSource[];\n    active?: SourceKind;\n    round?: Round;\n    tie?: TiePolicy;\n    announce?: 'reveal' | 'manual';\n};\nexport type VoteDesk = {\n    readonly state: VoteState;\n    snapshot(): DeskSnapshot;\n    load(round: Round): void;\n    open(): void;\n    close(): void;\n    reveal(winners?: readonly string[]): boolean;\n    announce(): void;\n    reset(): void;\n    use(kind: SourceKind): void;\n    setTie(policy: TiePolicy): void;\n    source<K extends SourceKind>(kind: K): Extract<AnySource, {\n        kind: K;\n    }> | undefined;\n    subscribe(listener: (snap: DeskSnapshot) => void): () => void;\n    destroy(): void;\n};\nexport declare function createVoteDesk(options: DeskOptions): VoteDesk;"
        },
        {
          "file": "stage.ts",
          "declarations": "import { type Ecc } from './qr';\nimport { type Nominee, type Standing, type VoteState } from './vote-model';\nexport type JoinOptions = {\n    url: string;\n    title?: string;\n    address?: string;\n    ecc?: Ecc;\n};\nexport type JoinCard = {\n    element: HTMLElement;\n    set(o: Partial<JoinOptions>): void;\n    destroy(): void;\n};\nexport declare function createJoin(host: HTMLElement, options: JoinOptions): JoinCard;\nexport declare const TALLY_LABELS: {\n    region: string;\n    votes: (n: string, count: number) => string;\n    draft: string;\n    open: string;\n    closed: string;\n    revealed: string;\n    saidOpen: (question: string) => string;\n    saidClosed: (votes: string) => string;\n    hidden: string;\n};\nexport type TallyOptions = {\n    kind?: 'bars' | 'ring';\n    shares?: boolean;\n    counts?: boolean;\n    blind?: boolean;\n    locale?: string;\n    labels?: Partial<typeof TALLY_LABELS>;\n    renderRow?: (row: HTMLElement, standing: Standing, state: VoteState) => void;\n};\nexport type Tally = {\n    element: HTMLElement;\n    update(state: VoteState): void;\n    setOptions(o: Partial<TallyOptions>): void;\n    destroy(): void;\n};\nexport declare function createTally(host: HTMLElement, options?: TallyOptions): Tally;\nexport type RevealPhase = 'idle' | 'nominees' | 'suspense' | 'winner';\nexport declare const REVEAL_LABELS: {\n    region: string;\n    nominees: string;\n    suspense: string;\n    winner: string;\n    tie: string;\n    share: (share: number) => string;\n    votes: (n: string, count: number) => string;\n    saidWinner: (names: string, share: number) => string;\n    saidTie: (names: string, share: number) => string;\n    and: string;\n};\nexport type RevealOptions = {\n    timing?: {\n        nominee?: number;\n        suspense?: number;\n    };\n    speed?: number;\n    auto?: boolean;\n    figures?: boolean;\n    order?: 'round' | 'countdown';\n    locale?: string;\n    labels?: Partial<typeof REVEAL_LABELS>;\n    renderNominee?: (card: HTMLElement, nominee: Nominee, info: {\n        winner: boolean;\n        standing: Standing;\n    }) => void;\n    animate?: (el: HTMLElement, phase: 'enter' | 'suspense' | 'winner' | 'exit') => Promise<unknown> | void;\n    onPhase?: (phase: RevealPhase) => void;\n    onWinner?: (winners: Nominee[], cards: HTMLElement[]) => void;\n};\nexport type Reveal = {\n    element: HTMLElement;\n    readonly phase: RevealPhase;\n    play(state: VoteState): Promise<void>;\n    step(): void;\n    show(state: VoteState, phase: Exclude<RevealPhase, 'idle'>): void;\n    reset(): Promise<void>;\n    setOptions(o: Partial<RevealOptions>): void;\n    destroy(): void;\n};\nexport declare function createReveal(host: HTMLElement, options?: RevealOptions): Reveal;"
        }
      ],
      "pitfalls": [
        "One vote per device is a promise kept by a random token in the phone’s storage",
        "The operator secret belongs in the Worker’s environment (wrangler secret put)",
        "Rate limits live in the room’s memory",
        "Phones get only words: titles, subtitles, the question",
        "A reveal freezes the counts",
        "Switching source keeps the numbers on stage",
        "The QR encoder stops at version 10 (213 bytes at level M, 151 at Q)",
        "The reference server has tests for its logic (through stand-in sockets), not a deployment",
        "Rooms delete themselves after ROOM_TTL_HOURS (48 by default)"
      ],
      "card": "entries/audience-vote.json"
    },
    {
      "id": "audio-engine",
      "aliases": [],
      "name": "Audio engine for shows",
      "summary": "Sound for a live show or an app, with Web Audio only: a music bed that crossfades between tracks and loops without a seam, cues started on the beat or the bar, groups with levels and mutes, ducking that dips the music just before a voice comes in, a limiter on the output, sounds decoded ahead of their segment and released after, and a show clock that hands cues to the audio thread on the sample. Before the first click, or while the system has taken audio away, the show runs silently on time and picks the sound up where it should be. While the page is hidden it pauses audio, its loops and your own nodes on the context too, and resumes when the page shows (`pauseWhenHidden: false` for a music player). A mixer panel (meters, faders, mutes) comes with it, plus stand-in sounds made from numbers.",
      "category": "systems",
      "role": "system",
      "stack": [
        "headless",
        "dom"
      ],
      "character": "calm",
      "tags": [
        "web audio",
        "music",
        "crossfade",
        "seamless loop",
        "ducking",
        "limiter",
        "mixer",
        "meters",
        "scheduling",
        "show clock",
        "autoplay",
        "page visibility",
        "preload",
        "synthesis",
        "deterministic",
        "accessibility",
        "keyboard",
        "touch",
        "rtl",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "live stage presentations and kiosks",
        "music and narration under a walkthrough",
        "games and interactive stories",
        "background music in an app, with a mixer in its settings",
        "sound cues synchronised with animation",
        "prototyping sound before the recordings exist"
      ],
      "interaction": "Click once to start sound · pick a bed, fire cues, play the sequence · faders take arrows, Page Up and Down, Home and End",
      "kits": [
        {
          "kit": "game",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "cue-console",
          "why": "Cues that start music and stings on the beat"
        },
        {
          "id": "ui-sounds",
          "why": "Interface sounds through the same groups and ducking"
        },
        {
          "id": "offline-narrator",
          "why": "Music ducks under the narration"
        }
      ],
      "variants": [],
      "version": "1.0.2",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0.05,
          "cpuP95Ms": 0.11,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the demo exercising itself: the 32-second sequence plays on a loop (beds crossfading, cues, ducking, a chased loop) and a fader moves every 30 frames. The bench run has no click, so the browser keeps audio locked: the engine runs its silent model on the same schedule, and what is timed is the main thread (the scheduler waking every half second, the demo’s own readouts, the mixer’s writes). Mixing runs on the audio thread, outside the frame; meters read nothing while silent."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.045,
          "cpuP95Ms": 0.1,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 164 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.02,
          "cpuP95Ms": 0.1,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 43 ms."
        }
      ],
      "signatures": [
        {
          "file": "audio-engine.ts",
          "declarations": "import { type FadeShape } from './automation';\nimport { type Grid, type LoopPoints } from './clock';\nimport { dbToGain, gainToDb, type Reading } from './levels';\nimport type { Synth } from './synth';\nexport type { FadeShape, Grid, LoopPoints, Reading, Synth };\nexport type SoundSource = string | ArrayBuffer | Blob | AudioBuffer | Synth;\nexport type SoundDef = {\n    source: SoundSource;\n    group?: string;\n    level?: number;\n    loop?: boolean | LoopPoints;\n    grid?: Grid;\n    duck?: boolean;\n    resume?: boolean;\n    preload?: boolean;\n};\nexport type When = 'now' | 'beat' | 'bar' | number;\nexport type PlayOptions = {\n    at?: When;\n    level?: number;\n    fadeIn?: number;\n    shape?: FadeShape;\n    offset?: number;\n    loop?: boolean | LoopPoints;\n    duck?: boolean;\n    pan?: number;\n    group?: string;\n    resume?: boolean;\n};\nexport type BedOptions = {\n    fade?: number;\n    shape?: FadeShape;\n    at?: When;\n    from?: 'start' | 'same';\n    level?: number;\n};\nexport type TimelineCue = ({\n    at: number;\n    sound: string;\n    chase?: boolean;\n} & Omit<PlayOptions, 'at'>) | ({\n    at: number;\n    bed: string | null;\n} & Omit<BedOptions, 'at'>) | {\n    at: number;\n    stop: string;\n    fade?: number;\n};\nexport type EngineState = 'locked' | 'starting' | 'running' | 'resting' | 'paused' | 'interrupted' | 'unsupported' | 'closed';\nexport type Voice = {\n    readonly id: number;\n    readonly sound: string;\n    readonly group: string;\n    readonly start: number;\n    readonly alive: boolean;\n    readonly audible: boolean;\n    position(): number;\n    stop(fade?: number, at?: number): void;\n    setLevel(db: number, fade?: number): void;\n    readonly ended: Promise<void>;\n};\nexport type MemoryReport = {\n    bytes: number;\n    budget: number;\n    sounds: Array<{\n        id: string;\n        bytes: number;\n        holds: number;\n        state: 'idle' | 'loading' | 'ready' | 'failed';\n        playing: number;\n    }>;\n};\nexport type Hold = {\n    readonly ready: Promise<string[]>;\n    readonly progress: number;\n    release(): void;\n};\nexport type EngineEvents = {\n    state: EngineState;\n    voice: {\n        voice: Voice;\n        phase: 'start' | 'end';\n    };\n    level: {\n        bus: string;\n        db: number;\n        muted: boolean;\n    };\n    load: {\n        id: string;\n        state: 'ready' | 'failed' | 'released';\n        bytes: number;\n    };\n    warn: {\n        code: 'not-ready' | 'unknown' | 'late' | 'budget' | 'decode';\n        detail: string;\n    };\n};\nexport type AudioEngineOptions = {\n    sounds?: Record<string, SoundDef>;\n    groups?: string[];\n    levels?: Record<string, number>;\n    duck?: {\n        by?: string[];\n        groups?: string[];\n        depth?: number;\n        attack?: number;\n        release?: number;\n    } | false;\n    limiter?: {\n        threshold?: number;\n        release?: number;\n    } | false;\n    sampleRate?: number;\n    latencyHint?: AudioContextLatencyCategory;\n    lookahead?: number;\n    idle?: number;\n    budget?: number;\n    pauseWhenHidden?: boolean;\n    context?: AudioContext;\n    target?: EventTarget;\n    fetch?: typeof fetch;\n};\nexport declare function createAudioEngine(options?: AudioEngineOptions): {\n    add: (id: string, def: SoundDef) => void;\n    remove(id: string): void;\n    has: (id: string) => boolean;\n    isReady: (id: string) => boolean;\n    preload: (ids: string[]) => Hold;\n    play: (id: string, o?: PlayOptions) => Voice | null;\n    bed: (id: string | null, o?: BedOptions) => Voice | null;\n    readonly currentBed: Voice | null;\n    voices(): Voice[];\n    stopAll(fadeOut?: number): void;\n    setLevel: (name: string, db: number, fadeTime?: number) => void;\n    level: (name: string) => number;\n    setDuck(o: {\n        depth?: number;\n        attack?: number;\n        release?: number;\n    }): void;\n    setMute: (name: string, muted: boolean, fadeTime?: number) => void;\n    isMuted: (name: string) => boolean;\n    readonly groups: string[];\n    meter(name: string): Reading;\n    readonly reduction: number;\n    timeline: {\n        set(list: TimelineCue[]): void;\n        readonly cues: readonly TimelineCue[];\n        play(from?: number): void;\n        pause(): void;\n        seek(t: number): void;\n        setRate(rate: number): void;\n        readonly time: number;\n        readonly running: boolean;\n        readonly rate: number;\n    };\n    now: () => number;\n    readonly state: EngineState;\n    readonly audible: boolean;\n    unlock(): void;\n    memory: () => MemoryReport;\n    readonly sampleRate: number;\n    readonly context: AudioContext | null;\n    on<K extends keyof EngineEvents>(type: K, fn: (e: EngineEvents[K]) => void): () => undefined;\n    destroy(): void;\n};\nexport type AudioEngine = ReturnType<typeof createAudioEngine>;\nexport { dbToGain, gainToDb };"
        },
        {
          "file": "mixer.ts",
          "declarations": "import type { AudioEngine } from './audio-engine';\nexport type StripInfo = {\n    bus: string;\n    label: string;\n    master: boolean;\n};\nexport type MixerOptions = {\n    strips?: string[];\n    labels?: Record<string, string>;\n    label?: string;\n    min?: number;\n    max?: number;\n    meters?: boolean;\n    messages?: Partial<typeof MESSAGES>;\n    renderStrip?: (el: HTMLElement, strip: StripInfo) => void;\n    animate?: (el: HTMLElement, phase: 'enter' | 'exit') => Promise<unknown> | void;\n};\nexport type Mixer = {\n    readonly element: HTMLElement;\n    refresh(): void;\n    destroy(): void;\n};\ndeclare const MESSAGES: {\n    mute: string;\n    muteLabel: string;\n    peak: string;\n    limiter: string;\n    unlock: string;\n    locked: string;\n    starting: string;\n    interrupted: string;\n    unsupported: string;\n    running: string;\n    resting: string;\n    paused: string;\n    closed: string;\n};\nexport declare function createMixer(host: HTMLElement, engine: AudioEngine, options?: MixerOptions): Mixer;\nexport {};"
        },
        {
          "file": "synth.ts",
          "declarations": "export type Synth = {\n    duration: number;\n    channels: number;\n    fill(channels: Float32Array[], sampleRate: number): void;\n};\nexport declare function random(seed: number): () => number;\nexport declare const hz: (note: number) => number;\nexport type BedOptions = {\n    bpm?: number;\n    chords?: number[][];\n    pulse?: boolean;\n    cutoff?: number;\n    seed?: number;\n    peak?: number;\n};\nexport declare const BED_CHORDS: number[][];\nexport declare function padBed(o?: BedOptions): Synth;\nexport declare function chime(o?: {\n    note?: number;\n    length?: number;\n    peak?: number;\n}): Synth;\nexport declare function whoosh(o?: {\n    length?: number;\n    seed?: number;\n    peak?: number;\n}): Synth;\nexport declare function tickLoop(o?: {\n    bpm?: number;\n    beats?: number;\n    peak?: number;\n}): Synth;\nexport declare function speechLike(o?: {\n    length?: number;\n    seed?: number;\n    pitch?: number;\n    peak?: number;\n}): Synth;"
        }
      ],
      "pitfalls": [
        "Browsers start audio only after a click, a tap or a key press on the page",
        "Preload a segment before its moment",
        "Decoded audio is big: 32-bit floats per sample per channel",
        "MP3 files carry silence at their start and end from the encoder",
        "A loop seams cleanly only if its two ends meet",
        "Drive visuals from engine.timeline.time, not from your own timer",
        "Timeline cues are handed to Web Audio up to one second ahead (lookahead)",
        "The limiter is a DynamicsCompressorNode set hard (ratio 20, no knee, 2 ms attack)",
        "After `idle` seconds with nothing playing the AudioContext is suspended",
        "One AudioContext per page",
        "While the page is hidden (a background tab, a minimised window) the engine suspends the…"
      ],
      "card": "entries/audio-engine.json"
    },
    {
      "id": "aurora",
      "aliases": [],
      "name": "Northern lights",
      "summary": "An aurora worked out as physics on WebGPU, seen from a frozen fjord: curtains as vortex sheets that curl and fold (a Biot–Savart sum in compute), electrons stopping at the height their energy reaches and leaving light in oxygen’s green and red lines and nitrogen’s pink feet, marched along the field lines so the rays stand up and meet overhead. Plain controls for strength, a substorm surge and the corona; a night-sky backdrop for any page or game.",
      "category": "simulation",
      "role": "hero-visual",
      "stack": [
        "webgpu"
      ],
      "character": "expressive",
      "tags": [
        "aurora",
        "vortex sheets",
        "biot–savart",
        "kelvin–helmholtz",
        "ray marching",
        "compute",
        "wgsl",
        "raw webgpu",
        "night sky",
        "emission lines"
      ],
      "useCases": [
        "night-sky backdrops and hero sections",
        "splash and loading screens",
        "winter and polar scenes in games",
        "ambient screens and screensavers",
        "science and planetarium visuals"
      ],
      "interaction": "Drag or use the arrow keys to look around · space for a substorm",
      "kits": [],
      "pairsWith": [
        {
          "id": "physical-sky",
          "why": "The night sky and stars the aurora hangs in"
        },
        {
          "id": "capability-tiers",
          "why": "Pick its quality tier before the first frame"
        },
        {
          "id": "dynamic-resolution",
          "why": "Hold the frame budget while the curtains fold"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "Low quality: a third of the electrons, the aurora marched at about 0.25 MP.",
          "low": "Low quality: a third of the electrons, the aurora marched at about 0.25 MP, fewer steps over the fjord; the picture drawn at no more than 1 MP and stretched."
        },
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 3.162,
          "cpuMs": 0.12,
          "cpuP95Ms": 0.2,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Looking round the sky with a substorm every 20 s: the sheets’ Biot–Savart step, 65,536 electrons and the light they leave, the oval, the aurora marched at about 0.45 MP and the fjord traced at the full stage, timed with its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 18.416,
          "cpuMs": 0.21,
          "cpuP95Ms": 0.42,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 1615 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 14.687,
          "cpuMs": 0.3,
          "cpuP95Ms": 0.42,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 454 ms."
        }
      ],
      "signatures": [
        {
          "file": "aurora-still.ts",
          "declarations": "import { type AuroraColours } from './aurora-sim';\nexport declare function drawAuroraStill(g: CanvasRenderingContext2D, w: number, h: number, dpr: number, o?: {\n    strength?: number;\n    corona?: number;\n    stars?: number;\n    colours?: Partial<AuroraColours>;\n}): void;"
        },
        {
          "file": "aurora.ts",
          "declarations": "import { type AuroraColours, type AuroraQuality } from './aurora-sim';\nexport type { AuroraColours, AuroraQuality } from './aurora-sim';\nexport declare const AURORA_TIER_QUALITY: Record<'high' | 'medium' | 'low', AuroraQuality>;\nexport declare const AURORA_TIER_PIXELS: Record<'high' | 'medium' | 'low', number>;\nexport declare function auroraDrawSize(width: number, height: number, tier?: 'high' | 'medium' | 'low'): {\n    width: number;\n    height: number;\n};\nexport type AuroraControls = {\n    strength: number;\n    surge: number;\n    corona: number;\n    speed: number;\n    stars: number;\n};\nexport type AuroraOptions = {\n    device?: GPUDevice;\n    format?: GPUTextureFormat;\n    quality?: AuroraQuality;\n    tier?: 'high' | 'medium' | 'low';\n    arcs?: number;\n    energy?: number;\n    seed?: number;\n    fov?: number;\n    colours?: Partial<AuroraColours>;\n    controls?: Partial<AuroraControls>;\n};\nexport type SubstormOptions = {\n    peak?: number;\n    corona?: number;\n    rise?: number;\n    fall?: number;\n};\nexport type Aurora = {\n    readonly device: GPUDevice;\n    readonly format: GPUTextureFormat;\n    readonly controls: Readonly<AuroraControls>;\n    set(controls: Partial<AuroraControls>): void;\n    look(yaw: number, pitch: number): void;\n    substorm(options?: SubstormOptions): void;\n    readonly storming: boolean;\n    readonly now: Readonly<{\n        strength: number;\n        surge: number;\n        corona: number;\n    }>;\n    resize(width: number, height: number): void;\n    setQuality(quality: AuroraQuality): void;\n    frame(dt: number): boolean;\n    step(dt: number): boolean;\n    encode(encoder: GPUCommandEncoder, view: GPUTextureView): void;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare function createAurora(canvas: HTMLCanvasElement | OffscreenCanvas | null, options?: AuroraOptions): Promise<Aurora | null>;"
        }
      ],
      "pitfalls": [
        "Reflections read off the screen’s own pass show a hard edge where the reflected ray leaves the…",
        "A heightfield traced by sphere steps runs out of steps on rays grazing a long slope a few…",
        "Rays near the horizon skim the flat ice 15 to 100 m over it",
        "Detail finer than a pixel (spruce crowns, snow crystals, stars bent by the ice’s ripples)…",
        "On a weaker GPU (harness tier medium or low, `tier` option) it draws at low quality",
        "On a phone (tier low) size the drawing with `auroraDrawSize`",
        "Call frame(dt) every animation frame even when nothing moves",
        "Never queue more than one frame ahead",
        "Its size is the drawing’s in device pixels",
        "The first frame after creating it",
        "The light is accumulated over time (green lives 0.7 s, red 4 s)",
        "The aurora is soft: it is marched at about half a megapixel and stretched",
        "Drawing into your own texture",
        "Without WebGPU createAurora returns null"
      ],
      "card": "entries/aurora.json"
    },
    {
      "id": "auto-instancer",
      "aliases": [],
      "name": "Automatic instancing",
      "summary": "Every plain opaque mesh in a scene is drawn through shared InstancedMeshes, one per geometry, material and shadow flags, with no change to the code that builds the scene. The originals stay in the graph on a layer no camera sees, so parenting, tweens, visible and material swaps keep working; once a frame, sync() copies their world matrices into the batches. A town of about 2,900 parts goes from about 4,900 draw calls a frame to 83. Raycast hits map back to the part, and parts it must not batch (see-through, mirrored, skinned, node materials) are drawn as before.",
      "category": "technique",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "calm",
      "tags": [
        "instancing",
        "InstancedMesh",
        "draw calls",
        "batching",
        "performance",
        "cpu",
        "scene graph",
        "layers",
        "raycasting",
        "shadows",
        "three.js",
        "webgpu",
        "webgl"
      ],
      "useCases": [
        "machines, rigs and buildings made of hundreds of small rigid parts",
        "kit-built levels: walls, props, fences and trees placed one by one",
        "a scene whose code you cannot or do not want to rewrite for instancing",
        "cutting the CPU cost of shadow and reflection passes",
        "checking how many draw calls a scene really needs"
      ],
      "interaction": "Click any part to pick it · turn batching off in the card to see the same frame drawn part by part",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "static-merge",
          "why": "Merges different rigid geometry while this instances identical parts; use separate roots or disjoint source sets"
        },
        {
          "id": "gpu-memory-ledger",
          "why": "See the buffers instancing saves"
        },
        {
          "id": "ray-grid",
          "why": "Pick instances without walking every mesh"
        },
        {
          "id": "compile-without-stalls",
          "why": "Build the shared materials before the first frame"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-14",
          "gpuMs": 0.508,
          "cpuMs": 1.448,
          "cpuP95Ms": 1.84,
          "badge": "moderate",
          "drawCalls": 83,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured batched, at the default six-by-six town (about 2,900 parts: houses, fences, trees, lamps, windmills and cars) with the traffic and sails moving, so the moving parts rewrite their batches every frame. CPU time includes the scene walk and the instance writes. Turn batching off in the panel to see the same frame drawn part by part."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 2.949,
          "cpuMs": 3.86,
          "cpuP95Ms": 4.73,
          "badge": "heavy",
          "drawCalls": 83,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 727 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 4.737,
          "cpuMs": 1.64,
          "cpuP95Ms": 2.12,
          "badge": "heavy",
          "drawCalls": 83,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 824 ms."
        }
      ],
      "signatures": [
        {
          "file": "auto-instancer.ts",
          "declarations": "import { Group, type Intersection, type Mesh, type Object3D } from 'three';\nexport type AutoInstancerOptions = {\n    layer?: number;\n    idleFrames?: number;\n    nodeMaterials?: boolean;\n    filter?: (mesh: Mesh) => boolean;\n    updateMatrices?: boolean;\n};\nexport type InstancerStats = {\n    batches: number;\n    meshes: number;\n    skipped: number;\n};\nexport type AutoInstancer = {\n    sync(): void;\n    pick(hit: Pick<Intersection, 'object' | 'instanceId'>): Object3D;\n    hideSmall(radius: number): () => void;\n    stats(): InstancerStats;\n    release(mesh: Mesh): void;\n    setEnabled(on: boolean): void;\n    readonly enabled: boolean;\n    readonly group: Group;\n    dispose(): void;\n};\nexport declare function whyNot(mesh: Mesh, options?: Pick<AutoInstancerOptions, 'nodeMaterials' | 'filter'>): string | null;\nexport declare function mirrored(e: ArrayLike<number>): boolean;\nexport declare function createAutoInstancer(scene: Object3D, options?: AutoInstancerOptions): AutoInstancer;"
        },
        {
          "file": "compile-turn.ts",
          "declarations": "export declare function inTurn<T>(renderer: object, job: () => Promise<T>): Promise<T>;"
        }
      ],
      "pitfalls": [
        "Call sync() once a frame, after everything has moved and just before render()",
        "The originals move to layer 31 (option layer)",
        "Each batch covers the whole scene, so it is never frustum-culled",
        "A new geometry, material or shadow flag makes a new batch",
        "Left alone: see-through materials, morph targets, skinned and instanced meshes, and more",
        "A mesh whose world matrix is mirrored (negative scale) is drawn as itself while it is mirrored",
        "Material changes are seen through material.version",
        "A part taken out of the scene and added to another one without this instancer stays on the…",
        "Batching changes draw order",
        "Counts are not milliseconds"
      ],
      "card": "entries/auto-instancer.json"
    },
    {
      "id": "beside-placement",
      "aliases": [],
      "name": "Beside, never over: placing editors and popovers",
      "summary": "Puts an editor, popover or inspector beside the item it edits, never on top of it: above by default, else the side with the most room, slid along that side to stay on screen and clear of fixed chrome, with a tail pointing back; given what else is on screen, it takes a side that covers none of it. When no side has room it asks the view to pan and zoom to make some, and docks to an edge as a last resort. A follower keeps it beside a moving item and rests when nothing moves; fitSpan keeps menus on screen.",
      "category": "data",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "popover",
        "placement",
        "positioning",
        "flip",
        "shift",
        "tail",
        "docking",
        "inspector",
        "toolbar",
        "collision",
        "canvas",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "an item’s editor on a board or canvas",
        "inspectors beside a selected chart or shape",
        "popovers and pickers opened from a button",
        "menus and flyouts on short screens",
        "property panels that must not hide what they change",
        "a selection toolbar that keeps off nearby cards and lines and clear of a side rail"
      ],
      "interaction": "Click a card, then drag it toward an edge or another card · click the card under the zoom rail · drag the board to pan",
      "kits": [
        {
          "kit": "foundations",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "property-panel",
          "why": "The inspector it places beside the selection"
        },
        {
          "id": "comments-tasks",
          "why": "Comment threads opened beside their pin"
        },
        {
          "id": "menu-skins",
          "why": "Menus kept on screen by the same rules"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": null,
          "cpuMs": 1.045,
          "cpuP95Ms": 1.95,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured exercising itself: a card circles the board every frame and its editor follows it, choosing a side, sliding along it and redrawing the four candidate sides. Idle, the follower rests and nothing runs."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 1.265,
          "cpuP95Ms": 2.02,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 80 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 1.62,
          "cpuP95Ms": 2.66,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 68 ms."
        }
      ],
      "signatures": [
        {
          "file": "beside.ts",
          "declarations": "import { type Box, type Gap, type Side } from './placement';\nexport type Placement = {\n    kind: 'beside';\n    box: Box;\n    side: Side;\n    tail: number;\n} | {\n    kind: 'dock';\n    box: Box;\n    side: 'left' | 'right';\n} | {\n    kind: 'none';\n};\nexport type BesideOptions = {\n    target: () => Box | null;\n    area?: () => Box;\n    gap?: Gap;\n    prefer?: Side[];\n    sides?: Side[];\n    covers?: (box: Box) => boolean;\n    avoid?: () => Box[];\n    near?: () => {\n        x: number;\n        y: number;\n    } | undefined;\n    min?: {\n        w: number;\n        h: number;\n    };\n    size?: () => {\n        w: number;\n        h: number;\n    };\n    tail?: HTMLElement | null;\n    bringTo?: (to: Box, side: Side) => void;\n    settle?: number;\n    onPlace?: (placement: Placement, info: {\n        target: Box | null;\n        size: {\n            w: number;\n            h: number;\n        };\n        area: Box;\n    }) => void;\n    loop?: boolean;\n    idleFrames?: number;\n};\nexport type BesideHandle = {\n    place(): void;\n    follow(): void;\n    step(): boolean;\n    reset(): void;\n    readonly placement: Placement;\n    dispose(): void;\n};\nexport declare const windowArea: () => Box;\nexport declare function beside(el: HTMLElement, options: BesideOptions): BesideHandle;\nexport type KeepOnScreenOptions = {\n    area?: () => Box;\n    margin?: number | {\n        top?: number;\n        bottom?: number;\n        left?: number;\n        right?: number;\n    };\n};\nexport declare function keepOnScreen(el: HTMLElement, options?: KeepOnScreenOptions): {\n    fit(): void;\n    dispose(): void;\n};"
        },
        {
          "file": "placement.ts",
          "declarations": "export type Box = {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n};\nexport type Side = 'top' | 'bottom' | 'left' | 'right';\nexport type Beside = {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n    side: Side;\n    tail: number;\n};\nexport declare const GAP = 14;\nexport type Gap = number | Partial<Record<Side, number>>;\nexport declare const gapOn: (gap: Gap | undefined, side: Side) => number;\nexport declare function roomAround(target: Box, area: Box, gap?: Gap): Record<Side, number>;\nexport declare function boxOnSide(side: Side, target: Box, w: number, h: number, area: Box, gaps?: Gap, near?: {\n    x: number;\n    y: number;\n}): Beside;\nexport declare function slideClear(p: Beside, target: Box, area: Box, avoid: Box[]): Beside | null;\nexport type BesideOpts = {\n    gap?: Gap;\n    prefer?: Side[];\n    sides?: Side[];\n    near?: {\n        x: number;\n        y: number;\n    };\n    min?: {\n        w: number;\n        h: number;\n    };\n    covers?: (box: Box) => boolean;\n    avoid?: Box[];\n};\nexport declare function placeBeside(target: Box, size: {\n    w: number;\n    h: number;\n}, area: Box, opts?: BesideOpts): Beside | null;\nexport declare function sideCandidates(target: Box, size: {\n    w: number;\n    h: number;\n}, area: Box, opts?: Pick<BesideOpts, 'gap' | 'near' | 'covers' | 'avoid'>): Array<Beside & {\n    fits: boolean;\n    room: number;\n    clear: boolean;\n}>;\nexport declare function tailTip(p: Beside): {\n    x: number;\n    y: number;\n};\nexport declare function makeRoom(target: Box, size: {\n    w: number;\n    h: number;\n}, area: Box, gaps?: Gap): {\n    side: Side;\n    scale: number;\n    to: Box;\n} | null;\nexport declare function dockSide(target: Box, area: Box): 'left' | 'right';\nexport declare function dockAt(target: Box, size: {\n    w: number;\n    h: number;\n}, area: Box): Box & {\n    side: 'left' | 'right';\n};\nexport declare function overlaps(a: Box, b: Box): boolean;\nexport declare function union(a: Box, b: Box | null | undefined): Box;\nexport declare function fitSpan(top: number, height: number, viewport: number, above?: number, below?: number): {\n    shift: number;\n    max: number | null;\n};"
        }
      ],
      "pitfalls": [
        "Rects are viewport pixels (getBoundingClientRect) for the target and the area alike",
        "The follower rests after a few still frames",
        "It stays still while the pointer is over the editor or dragging from it",
        "bringTo is asked at most once per opening (reset() is an opening)",
        "With min, the binder writes width and height when it shrinks or docks",
        "Options are read on every placement",
        "Keep the area clear of your own fixed chrome (a top bar, a bottom toolbar)",
        "covers is asked up to once a side on every placement"
      ],
      "card": "entries/beside-placement.json"
    },
    {
      "id": "breakable-world",
      "aliases": [],
      "name": "Breakable world",
      "summary": "Walls that take ragged holes, buildings that come down, and rubble that stays. One damage bus takes impacts, blasts and rams; six materials answer each with a minimum and a resistance; holes merge and blow out the doors and windows they meet, and every wall face is re-triangulated round them. A building falls by a support rule you can see (half its walls open at waist height, or two at a corner): it shudders, leans toward the open walls, crumples into a heap with a walkable ramp. Panes smash with jittered strength, rocks break into rubble laid from their key, props topple about the push, trees break at their most damaged height and hinge over. All the rubble in the world is three instanced draws.",
      "category": "simulation",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "balanced",
      "tags": [
        "destruction",
        "damage",
        "breach",
        "wall holes",
        "collapse",
        "rubble",
        "debris",
        "dust",
        "triangulation",
        "earcut",
        "instancing",
        "vertex fold",
        "tsl",
        "support rule",
        "materials",
        "blast",
        "impact",
        "ram",
        "topple",
        "felling",
        "pure core",
        "seeded",
        "webgpu"
      ],
      "useCases": [
        "walls a player blows or drives through, with the hole cut in the mesh and in the collision",
        "buildings that come down when enough of their walls are gone, leaving a heap you can walk over",
        "windows that smash and doors blown in by a blast nearby",
        "rocks, lamp posts, fences, crates and trees that break, topple or fall when pushed hard enough",
        "one place every source of damage reports to, so sound, effects and a server hang off one answer",
        "a debris field that costs a few draws however much has fallen"
      ],
      "interaction": "Click to blast or strike · 1 2 3 pick impact, blast or ram · W A S D drive the ram box · V support view · drag to orbit",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "ring-effects",
          "why": "Dust, sparks and marks at each hit"
        },
        {
          "id": "mesh-dents",
          "why": "Dents on what bends rather than breaks"
        },
        {
          "id": "ray-grid",
          "why": "Shots and blasts found against big static meshes"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "Fewer debris pieces and dust puffs.",
          "low": "A 1024 shadow map, fewer debris pieces, and fewer, larger dust puffs."
        },
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-13",
          "gpuMs": 0.559,
          "cpuMs": 1.075,
          "cpuP95Ms": 1.455,
          "badge": "moderate",
          "drawCalls": 121,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured from the first frame, when the brick house is brought down whole (four blasts, a collapse, rubble, debris and dust); then a blast every 0.7 s round the block until three buildings have come down (collapses, rubble heaps, debris and dust), then resetting: five buildings, about 200 panes, 30 props, trees and rocks, a 2048 shadow map. At rest nothing is drawn."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 1.846,
          "cpuMs": 0.4,
          "cpuP95Ms": 3.02,
          "badge": "moderate",
          "drawCalls": 121,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 280 ms."
        }
      ],
      "signatures": [
        {
          "file": "building-damage.ts",
          "declarations": "import { type Blast, type DamageOutcome, type DamageTaker, type Impact, type Ram } from './damage-bus';\nimport { type Building, type BuildingBreaches } from './walls';\nimport { type OpeningHarm } from './windows';\nexport declare class BuildingDamage implements DamageTaker {\n    readonly buildings: ReadonlyMap<string, Building>;\n    readonly harm: Map<string, BuildingBreaches>;\n    readonly openings: Map<string, OpeningHarm>;\n    constructor(buildings: Iterable<Building>);\n    state(id: string): BuildingBreaches;\n    drainChanged(): string[];\n    impact(e: Impact, out: DamageOutcome): boolean;\n    blast(e: Blast, out: DamageOutcome): void;\n    ram(e: Ram, out: DamageOutcome): void;\n}"
        },
        {
          "file": "building-mesh.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { CollapsePose } from './collapse';\nimport { type Building, type BuildingBreaches } from './walls';\nexport type BuildingLook = {\n    wall(edge: number): THREE.Color;\n    core: THREE.Color;\n    inside: THREE.Color;\n    floor: THREE.Color;\n    roof: THREE.Color;\n};\nexport declare function buildingGeometry(building: Building, state: BuildingBreaches, look: BuildingLook): THREE.BufferGeometry;\nexport declare function collapseMatrix(pose: CollapsePose, pivot: THREE.Vector3, axis: THREE.Vector3, out?: THREE.Matrix4): THREE.Matrix4;"
        },
        {
          "file": "collapse.ts",
          "declarations": "import type { Vec2 } from './walls';\nexport declare const SHUDDER = 0.35;\nexport declare const FALL = 1.9;\nexport declare const LEAN = 0.22;\nexport declare const WOBBLE = 0.06;\nexport type CollapsePose = {\n    going: number;\n    shakeX: number;\n    shakeZ: number;\n    sink: number;\n    lean: number;\n    squash: number;\n    spread: number;\n    heaped: boolean;\n    done: boolean;\n};\nexport declare function collapsePose(age: number, height: number, lean: number): CollapsePose;\nexport declare function leanAxis(toward: Vec2 | null): {\n    x: number;\n    y: number;\n    z: number;\n};\nexport type Heap = {\n    ring: Vec2[];\n    middle: Vec2;\n    base: number;\n    peak: number;\n    reach: number;\n    grown: Vec2[];\n    heightAt(x: number, z: number): number;\n};\nexport declare function centroid(ring: readonly Vec2[]): Vec2;\nexport declare function pointInPolygon(p: Vec2, ring: readonly Vec2[]): boolean;\nexport declare const RAMP_FOOT = 2.2;\nexport declare function edgeDistance(p: Vec2, ring: readonly Vec2[]): number;\nexport declare function heapOf(ring: Vec2[], base: number, height: number): Heap;"
        },
        {
          "file": "damage-bus.ts",
          "declarations": "export type Point = {\n    x: number;\n    y: number;\n    z: number;\n};\nexport type Impact = {\n    kind: 'impact';\n    at: Point;\n    along: Point;\n    force: number;\n    target?: string;\n};\nexport type Blast = {\n    kind: 'blast';\n    at: Point;\n    radius: number;\n    force: number;\n};\nexport type RamBody = {\n    x: number;\n    z: number;\n    vx: number;\n    vz: number;\n    mass: number;\n    yaw: number;\n    length: number;\n    width: number;\n    height: number;\n};\nexport type Ram = {\n    kind: 'ram';\n    body: RamBody;\n};\nexport type DamageEvent = Impact | Blast | Ram;\nexport type Broke = {\n    what: 'wall' | 'pane' | 'door' | 'building' | 'rock' | 'prop' | 'tree';\n    key: string;\n    at: Point;\n    along: Point;\n    material: string;\n    size: number;\n};\nexport type DamageOutcome = {\n    taken: boolean;\n    broke: Broke[];\n    chipped: Point[];\n    blocked: boolean;\n};\nexport interface DamageTaker {\n    impact?(event: Impact, out: DamageOutcome): boolean;\n    blast?(event: Blast, out: DamageOutcome): void;\n    ram?(event: Ram, out: DamageOutcome): void;\n}\nexport declare const emptyOutcome: () => DamageOutcome;\nexport declare class DamageBus {\n    constructor(takers: () => Iterable<DamageTaker | null | undefined>);\n    report(event: DamageEvent): DamageOutcome;\n}\nexport declare function away(from: Point, to: Point): Point;\nexport declare function ramOverlaps(body: RamBody, box: {\n    x: number;\n    z: number;\n    halfX: number;\n    halfZ: number;\n    cos: number;\n    sin: number;\n}, ahead?: number): boolean;"
        },
        {
          "file": "rubble-batch.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { type Piece, type PieceId } from './rubble';\nexport declare function pieceGeometry(piece: PieceId): THREE.BufferGeometry;\nexport declare function batchGeometry(pieces: readonly PieceId[]): THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>;\nexport declare const pieceTriangles: (piece: PieceId) => number;\nexport declare function rubbleMaterial(): THREE.MeshStandardNodeMaterial;\nexport declare function rubbleMesh(geometry: THREE.BufferGeometry, material: THREE.Material, room: number, name: string): {\n    mesh: THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap>, THREE.Object3DEventMap>;\n    inst: THREE.InstancedBufferAttribute;\n};\nexport declare class RubbleBatches {\n    readonly object3D: THREE.Group<THREE.Object3DEventMap>;\n    readonly material: THREE.MeshStandardNodeMaterial;\n    readonly geometries: Record<'small' | 'long' | 'heap', THREE.BufferGeometry>;\n    constructor(room?: {\n        small: number;\n        long: number;\n        heap: number;\n    });\n    add(pieces: readonly Piece[]): void;\n    clear(): void;\n    warmUp(): void;\n    get cost(): {\n        draws: number;\n        pieces: number;\n        triangles: number;\n        vertices: number;\n    };\n    dispose(): void;\n}"
        },
        {
          "file": "rubble.ts",
          "declarations": "import { type Quat } from './quat';\nimport { type Heap } from './collapse';\nimport { type Building, type BuildingBreaches, type Vec2 } from './walls';\nexport declare const PIECE: {\n    readonly chunkA: 0;\n    readonly chunkB: 1;\n    readonly chunkC: 2;\n    readonly shard: 3;\n    readonly slab: 4;\n    readonly beam: 5;\n    readonly heapSmall: 6;\n    readonly heapLarge: 7;\n};\nexport type PieceId = (typeof PIECE)[keyof typeof PIECE];\nexport declare const BATCHES: Record<'small' | 'long' | 'heap', PieceId[]>;\nexport declare const batchOf: (piece: PieceId) => \"small\" | \"long\" | \"heap\";\nexport declare const HEAP_LARGE: {\n    across: number;\n    tall: number;\n};\nexport type Piece = {\n    piece: PieceId;\n    x: number;\n    y: number;\n    z: number;\n    q: Quat;\n    sx: number;\n    sy: number;\n    sz: number;\n    tint: string;\n    shade: number;\n};\nexport type RubbleLook = {\n    face: string;\n    core: string;\n    roof?: string;\n    rebar?: boolean;\n};\nexport declare function layHeap(heap: Heap, look: RubbleLook, seed: number): Piece[];\nexport declare function spillOf(at: {\n    x: number;\n    y: number;\n    z: number;\n}, normal: Vec2, side: 1 | -1, width: number, thickness: number, look: RubbleLook, seed: number): Piece[];\nexport declare function rimStrips(building: Building, state: BuildingBreaches, look: RubbleLook): Piece[];"
        },
        {
          "file": "walls.ts",
          "declarations": "import type { MaterialId } from './materials';\nexport type Vec2 = {\n    x: number;\n    z: number;\n};\nexport type Opening = {\n    id: string;\n    edge: number;\n    storey: number;\n    offset: number;\n    kind: 'door' | 'window';\n    width: number;\n    height: number;\n    sill: number;\n};\nexport type Building = {\n    id: string;\n    footprint: Vec2[];\n    ground: number;\n    storeys: number;\n    storeyHeight: number;\n    thickness: number;\n    material: MaterialId;\n    openings: Opening[];\n    parapet?: number;\n    roof?: 'flat' | 'hip';\n};\nexport type WallSegment = {\n    edge: number;\n    a: Vec2;\n    b: Vec2;\n    dir: Vec2;\n    normal: Vec2;\n    length: number;\n    innerStart: number;\n    innerEnd: number;\n};\nexport type Breach = {\n    edge: number;\n    minU: number;\n    maxU: number;\n    minV: number;\n    maxV: number;\n    floor: boolean;\n    seed: number;\n};\nexport type BuildingBreaches = {\n    breaches: Breach[];\n    taken: string[];\n    fallen: boolean;\n};\nexport declare const NO_BREACHES: BuildingBreaches;\nexport declare const CORNER = 0.12;\nexport declare const MERGE_GAP = 0.15;\nexport declare const NARROWEST = 0.45;\nexport declare const WALL_DOWN = 0.55;\nexport declare const WAIST = 1.1;\nexport declare const CORNER_TURN: number;\nexport declare function wallSegments(building: Pick<Building, 'footprint' | 'thickness'>): WallSegment[];\nexport declare const wallHeight: (b: Pick<Building, \"storeys\" | \"storeyHeight\" | \"parapet\">) => number;\nexport declare function breachableWall(building: Building, edge: number): {\n    lo: number;\n    hi: number;\n    top: number;\n    length: number;\n} | null;\nexport type WallHit = {\n    edge: number;\n    u: number;\n    v: number;\n    out: number;\n};\nexport declare function wallHit(building: Building, at: {\n    x: number;\n    y: number;\n    z: number;\n}, reach?: number): WallHit | null;\ntype Box = {\n    minU: number;\n    maxU: number;\n    minV: number;\n    maxV: number;\n};\nexport declare function openingBox(building: Building, o: Opening): Box;\nexport declare function breachWall(building: Building, state: BuildingBreaches, hit: {\n    edge: number;\n    u: number;\n    v: number;\n}, size: {\n    width: number;\n    height: number;\n    floor?: boolean;\n}): BuildingBreaches;\nexport declare function wallsOpen(building: Building, state: BuildingBreaches): Map<number, number>;\nexport declare function cornerTurn(building: Pick<Building, 'footprint'>, k: number): number;\nexport declare function fallsWhen(building: Building, state: BuildingBreaches): boolean;\nexport type WallHole = Box & {\n    outline: Vec2[];\n    kind: 'breach' | 'door' | 'window';\n    id: string;\n    floor: boolean;\n};\nexport declare function wallHoles(building: Building, state: BuildingBreaches): Map<number, WallHole[]>;\nexport declare function breachOutline(width: number, height: number, seed: number, floor: boolean, centreU: number, bottomV: number): Vec2[];\nexport declare function wallFace(holes: readonly WallHole[], start: number, end: number, top: number): {\n    contour: Vec2[];\n    holes: Vec2[][];\n    notches: WallHole[];\n};\nexport declare function holeSize(width: number, floor?: boolean): {\n    width: number;\n    height: number;\n    floor: boolean;\n};\nexport declare function wallPoint(building: Pick<Building, 'ground'>, s: WallSegment, u: number, v: number, out?: number): {\n    x: number;\n    y: number;\n    z: number;\n};\nexport declare function openingPlace(building: Building, o: Opening): {\n    at: {\n        x: number;\n        y: number;\n        z: number;\n    };\n    width: number;\n    height: number;\n    yaw: number;\n    facing: Vec2;\n};\nexport declare function innerRing(building: Pick<Building, 'footprint' | 'thickness'>): Vec2[];\nexport declare function leanToward(building: Building, state: BuildingBreaches): Vec2 | null;\nexport {};"
        }
      ],
      "pitfalls": [
        "Whole geometry swapped for rubble in one frame",
        "On a weaker GPU (harness tier medium or low) the demo draws a 1024 shadow map at low",
        "A hole standing on the floor (a door, a breach through the floor) touches the face’s outline",
        "Holes on one wall must never overlap or touch, or the triangulation folds",
        "Keep holes clear of the corners’ inner faces (`CORNER`, 0.12 m)",
        "Report a ram every step the body moves, and let a breach happen once",
        "Measure the support at waist height on the ground storey only",
        "The vertex fold makes every instance run every vertex of its batch",
        "An instanced mesh first drawn with no instances may never draw later ones (three r185 to r187)",
        "Three hands a material’s `positionNode` to the shadow pass",
        "A building that is falling is not a building any more",
        "Rams break through or are stopped",
        "Panes and trunks take a blast falling straight from its centre",
        "Every random choice (a hole’s teeth, a heap’s pieces, a pane’s strength) comes from a key or a…",
        "Broken edges (`rimStrips`) belong to the building",
        "Give each puff a seed of its own and draw its ragged edge and shade from that",
        "Dust sprites are turned to the camera with its right and up vectors as uniforms",
        "Rebuild a building’s geometry only when its harm changes (`drainChanged`)"
      ],
      "card": "entries/breakable-world.json"
    },
    {
      "id": "brush-through",
      "aliases": [],
      "name": "Brush through: plants and water that give way",
      "summary": "One shared touch field that anything moving presses (walkers, a cart, a boat, the pointer), and responders that read it in their vertex stage: bushes part branch by branch and spring back a little past rest, turned rigidly about the root so nothing stretches; reeds and tall flowers bend along an arc and whip back; lily pads slip aside, never through a wader, and drift home; a willow’s strands swing aside as slow pendulums, out of step; the water rings and trails a V wake; a pooled kick-up draw throws leaves, pollen and snow and lifts fireflies off a disturbed plant; and a wallow of mud, slush or honey takes a trough pressed to its floor, the liquid heaped in a rim round it, that flows shut over seconds, slower the thicker it is (feet, a cart’s ruts and a finger’s furrow alike), with footprints carried out of it. The field is a ring of 12.5 cm cells round a focus, pressed on the CPU only where something reaches and uploaded row by row, so it runs on WebGPU and on three’s WebGL2 backend alike. Nothing is stored per plant and nothing per plant runs on the CPU; each responder keeps its own timing as plain knobs a game can keep in its content. A sticky pool keeps a small field of its own, pressed by the same pushers, worked on the CPU only while someone wades or it settles, and drawn by its own shader with the trough cut for real.",
      "category": "simulation",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "balanced",
      "tags": [
        "foliage",
        "interaction",
        "touch field",
        "trample",
        "bushes",
        "reeds",
        "grass",
        "lily pads",
        "willow",
        "vines",
        "water",
        "ripples",
        "wake",
        "particles",
        "leaves",
        "pollen",
        "snow",
        "fireflies",
        "mud",
        "slush",
        "honey",
        "sticky liquid",
        "troughs",
        "ruts",
        "footprints",
        "viscosity",
        "springs",
        "rigid rotation",
        "vertex animation",
        "instancing",
        "tsl",
        "webgl fallback",
        "ring buffer",
        "seeded",
        "no dependencies"
      ],
      "useCases": [
        "a player walking through bushes, reeds and tall grass that part and spring back",
        "a vehicle laying plants over and leaving them to stand up again",
        "lily pads, leaves or debris on a pond pushed aside by a wader or a boat",
        "a curtain of vines, a willow or a bead curtain swinging aside as someone passes",
        "a pointer brushing through a garden or a product scene",
        "leaves, pollen, snow and fliers released where something disturbs the plants",
        "footprints in frost, and a path through leaf litter that stays clear",
        "tuning each plant’s response per kind and keeping the values in a game’s content",
        "wading through mud, slush, honey or any thick liquid that is pushed aside and flows shut behind",
        "wheel ruts through a mud patch that close again, and footprints carried out of it",
        "a finger drawing a furrow through a thick liquid in a product or a toy"
      ],
      "interaction": "Click the ground to walk · drag to look round · try the cart, the boat and your hand",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "meadow-grass",
          "why": "Grass that parts round the same walkers"
        },
        {
          "id": "plants-burn",
          "why": "The same plants, catching fire"
        },
        {
          "id": "humanoid-rig",
          "why": "Walkers whose feet press the touch field"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "mixed",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.554,
          "cpuMs": 1.775,
          "cpuP95Ms": 3.855,
          "badge": "moderate",
          "drawCalls": 40,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured on the tour, stepped a 60th of a second a frame (so the uncapped run walks it as at 60 Hz): the measured frames begin with the walker in the hedge and follow it through the reeds and flowers into the lily pond (rings, wake, pads), so bushes, stems, pads and water all move, with kick-ups, a 2048 shadow map and the touch field pressed and uploaded on the CPU every frame. The wallow (station 7) lies behind the start: nobody wades it in the measured frames, so its pool sleeps and costs only its draw where it is in view. The preview is posed: the hedge parting with the pond behind, held still."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 3.736,
          "cpuMs": 2.205,
          "cpuP95Ms": 3.115,
          "badge": "heavy",
          "drawCalls": 38,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 2614 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 4.026,
          "cpuMs": 1.36,
          "cpuP95Ms": 1.8,
          "badge": "heavy",
          "drawCalls": 38,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 4525 ms."
        }
      ],
      "signatures": [
        {
          "file": "float.ts",
          "declarations": "import type { Node } from 'three/webgpu';\nimport type { Knob } from './lean';\nimport type { FieldReader } from './touch-field';\nimport type { TouchCore } from './touch-core';\ntype F = Node<'float'>;\ntype V2 = Node<'vec2'>;\ntype V3 = Node<'vec3'>;\nexport type FloatResponse = {\n    reach: number;\n};\nexport declare const FLOAT_KNOBS: Record<keyof FloatResponse, Knob>;\nexport declare const FLOAT_RECOMMENDED: FloatResponse;\nexport declare const FLOAT_REACH: number;\nexport declare const FLOAT_INNER = 0.2;\nexport declare const FLOAT_RING = 0.9;\nexport declare const FLOAT_TAPS = 8;\nexport declare const FLOAT_BOB = 0.012;\nexport declare const FLOAT_SWAY = 0.08;\nexport declare const FLOAT_SPIN = 0.55;\nexport declare function floatSeed(a: number, b: number): {\n    side: readonly [\n        number,\n        number\n    ];\n    spin: number;\n};\nexport declare const floatTrail: (core: TouchCore) => (x: number, z: number) => readonly [\n    number,\n    number\n];\nexport declare const floatTrailNode: (field: FieldReader) => (xz: V2) => any & import(\"three/src/nodes/core/Node.js\").NodeElements & import(\"three/src/nodes/core/Node.js\").NodeExtensions<\"vec2\"> & import(\"three/src/nodes/core/Node.js\").NumOrBoolVec2Extensions<\"float\"> & import(\"three/src/nodes/core/Node.js\").Vec2Extensions & import(\"three/src/nodes/core/Node.js\").NumVec2Extensions<\"float\"> & import(\"three/src/nodes/core/Node.js\").FloatVecExtensions<\"vec2\"> & import(\"three/src/nodes/core/Node.js\").FloatOrVecExtensions<\"vec2\"> & {\n    __TypeScript_NODE_TYPE__: \"vec2\";\n};\nexport declare function floatPush(sample: (x: number, z: number) => readonly [\n    number,\n    number\n], x: number, z: number, side: readonly [\n    number,\n    number\n], reach?: number): {\n    x: number;\n    z: number;\n    stirred: number;\n};\nexport declare function floatPushNode(trail: (xz: V2) => V2, at: V2, side: V2, reach?: F | number): {\n    offset: V2;\n    stirred: F;\n};\nexport declare function floatRide(o: {\n    at: V2;\n    seed: V2;\n    time: F;\n    trail?: (xz: V2) => V2;\n    water?: (xz: V2) => V3;\n    reach?: F | number;\n    calm?: F | number;\n}): {\n    offset: V3;\n    yaw: F;\n    tilt: V2;\n    stirred: F;\n};\nexport declare function tiltBy(v: V3, tilt: V2, normal?: boolean): V3;\nexport declare function yawBy(v: V3, yaw: F): V3;\nexport {};"
        },
        {
          "file": "kickups.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\nimport type { TouchCore } from './touch-core';\ntype F = Node<'float'>;\nexport type KickKind = 'leaf' | 'pollen' | 'snow' | 'flier';\nexport declare const KICKS: {\n    readonly leaf: {\n        readonly drag: 3.2;\n        readonly gravity: 4.5;\n        readonly size: 0.12;\n        readonly life: 9;\n    };\n    readonly pollen: {\n        readonly drag: 3.2;\n        readonly gravity: 0.3;\n        readonly size: 0.032;\n        readonly life: 4.5;\n    };\n    readonly snow: {\n        readonly drag: 2.6;\n        readonly gravity: 4.5;\n        readonly size: 0.05;\n        readonly life: 4;\n    };\n    readonly flier: {\n        readonly size: 0.05;\n        readonly flight: 7;\n        readonly rise: 1.4;\n        readonly loop: 1.3;\n    };\n};\nexport declare const SNOW_ON_TOP = 0.55;\nexport type KickSource = {\n    x: number;\n    z: number;\n    y: number;\n    kind: 'leaf' | 'pollen' | 'snow';\n    amount?: number;\n    fliers?: boolean;\n};\nexport declare class Kickups {\n    readonly mesh: THREE.Mesh;\n    readonly clock: THREE.UniformNode<\"float\", number>;\n    readonly dusk: THREE.UniformNode<\"float\", number>;\n    readonly calm: THREE.UniformNode<\"float\", number>;\n    readonly light: THREE.UniformNode<\"color\", THREE.Color>;\n    readonly ground: THREE.UniformNode<\"float\", number>;\n    constructor(options?: {\n        capacity?: number;\n        seed?: number;\n    });\n    setFliers(homes: ReadonlyArray<readonly [\n        number,\n        number,\n        number\n    ]>): void;\n    lift(x: number, z: number, radius: number): void;\n    emit(kind: Exclude<KickKind, 'flier'>, x: number, y: number, z: number, count: number, o?: {\n        dirX?: number;\n        dirZ?: number;\n        speed?: number;\n        up?: number;\n        spread?: number;\n    }): void;\n    watch(sources: ReadonlyArray<KickSource>): void;\n    update(core: TouchCore | null, dt: number): void;\n    clear(): void;\n    dispose(): void;\n}\nexport declare function snowCapNode(o: {\n    up: F;\n    rise: F;\n    cover: F | number;\n    shaken: F;\n}): F;\nexport {};"
        },
        {
          "file": "lean.ts",
          "declarations": "import type { Node } from 'three/webgpu';\nimport type { FieldReader } from './touch-field';\ntype F = Node<'float'>;\ntype V2 = Node<'vec2'>;\ntype V3 = Node<'vec3'>;\ntype V4 = Node<'vec4'>;\nexport type LeanResponse = {\n    strength: number;\n    flex: number;\n    returnSeconds: number;\n    bounce: number;\n};\nexport type Knob = {\n    label: string;\n    hint: string;\n    min: number;\n    max: number;\n    step: number;\n    unit: string;\n};\nexport declare const LEAN_KNOBS: Record<keyof LeanResponse, Knob>;\nexport declare const LEAN_RECOMMENDED: LeanResponse;\nexport declare function resolveLean(raw: unknown): LeanResponse;\nexport declare const LEAN_RING: {\n    readonly share: 0.5;\n    readonly min: 0.2;\n    readonly max: 1.2;\n};\nexport declare const LEAN_TAPS = 6;\nexport declare function leanKnobs(lean: LeanResponse): {\n    strength: number;\n    flex: number;\n    damping: number;\n    pace: number;\n};\nexport declare const LEAN_RING_DIRECTIONS: (readonly [\n    number,\n    number\n])[];\nexport type LeanTap = readonly [\n    number,\n    number,\n    number\n];\nexport type LeanKnobs = ReturnType<typeof leanKnobs>;\nexport type LeanShape = {\n    height: number;\n    spread: number;\n    still?: number;\n};\nexport declare const leanReach: (spread: number) => number;\nexport declare function leanTurnsCpu(local: readonly [\n    number,\n    number,\n    number\n], c: LeanTap, ring: readonly LeanTap[], knobs: LeanKnobs, shape: LeanShape, seed: readonly [\n    number,\n    number\n]): readonly [\n    number,\n    number,\n    number,\n    number\n];\nexport declare function leanTurnCpu(v: readonly [\n    number,\n    number,\n    number\n], turn: readonly [\n    number,\n    number\n]): readonly [\n    number,\n    number,\n    number\n];\nexport declare function leanCpu(v: readonly [\n    number,\n    number,\n    number\n], turns: readonly number[]): readonly [\n    number,\n    number,\n    number\n];\nexport declare const leanTurnNode: import(\"three/tsl\").FnNode<[\n    Node<\"vec3\"> | import(\"three\").Vector3,\n    Node<\"vec2\"> | import(\"three\").Vector2\n], import(\"three/webgpu\").JoinNode<\"vec3\">>;\nexport declare const leanTurnsNode: import(\"three/tsl\").FnNode<(Node<\"vec2\"> | Node<\"vec3\"> | Node<\"vec4\"> | import(\"three\").Vector3 | import(\"three\").Vector2 | import(\"three\").Vector4)[], import(\"three/webgpu\").VarNode<\"vec4\", import(\"three/webgpu\").ConstNode<\"vec4\", import(\"three\").Vector4>>>;\nexport declare function leanVertex(o: {\n    field: FieldReader;\n    at: V2;\n    local: V3;\n    normal: V3;\n    height: F;\n    spread: F;\n    still: F;\n    knobs: V4;\n    seed: V2;\n}): {\n    position: V3;\n    normal: V3;\n};\nexport {};"
        },
        {
          "file": "plant-instances.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\ntype F = Node<'float'>;\ntype V2 = Node<'vec2'>;\ntype V3 = Node<'vec3'>;\ntype V4 = Node<'vec4'>;\nexport declare function seeded(seed: number): () => number;\nexport type PlantFrame = {\n    root: V3;\n    at: V2;\n    local: V3;\n    normal: V3;\n    size: F;\n    seed: V2;\n    still: F;\n    place: V4;\n    look: V4;\n};\nexport type PlantInstanceOptions = {\n    seed?: number;\n    still?: (index: number) => number;\n    seeds?: (index: number) => readonly [\n        number,\n        number\n    ];\n    spare?: (index: number) => number;\n};\nexport declare function plantInstances(mesh: THREE.InstancedMesh, options?: PlantInstanceOptions): {\n    frame: PlantFrame;\n    place: THREE.InstancedBufferAttribute;\n    look: THREE.InstancedBufferAttribute;\n    refresh: () => void;\n};\nexport declare function useMoved(material: THREE.NodeMaterial, frame: PlantFrame, moved: {\n    position: V3;\n    normal: V3;\n}): void;\nexport {};"
        },
        {
          "file": "stems.ts",
          "declarations": "import type { Node } from 'three/webgpu';\nimport type { Knob } from './lean';\nimport type { FieldReader } from './touch-field';\ntype F = Node<'float'>;\ntype V2 = Node<'vec2'>;\ntype V3 = Node<'vec3'>;\ntype V4 = Node<'vec4'>;\nexport type StemResponse = {\n    stiffness: number;\n    whip: number;\n    flatten: number;\n};\nexport declare const STEM_KNOBS: Record<keyof StemResponse, Knob>;\nexport declare const STEM_RECOMMENDED: StemResponse;\nexport declare function stemKnobs(stem: StemResponse): {\n    bend: number;\n    damping: number;\n    pace: number;\n    most: number;\n};\nexport type StemKnobs = ReturnType<typeof stemKnobs>;\nexport declare function stemTurnCpu(tap: readonly [\n    number,\n    number,\n    number\n], knobs: StemKnobs): readonly [\n    number,\n    number\n];\nexport declare const stemSoft: (seedY: number) => number;\nexport declare const stemPushCpu: (tap: readonly [\n    number,\n    number,\n    number\n], knobs: StemKnobs, seedY: number) => readonly [\n    number,\n    number\n];\nexport declare function stemBendCpu(p: readonly [\n    number,\n    number,\n    number\n], turn: readonly [\n    number,\n    number\n], height: number): readonly [\n    number,\n    number,\n    number\n];\nexport declare function stemNormalCpu(n: readonly [\n    number,\n    number,\n    number\n], y: number, turn: readonly [\n    number,\n    number\n], height: number): readonly [\n    number,\n    number,\n    number\n];\nexport declare const stemBendNode: import(\"three/tsl\").FnNode<[\n    Node<\"vec3\"> | import(\"three\").Vector3,\n    Node<\"vec2\"> | import(\"three\").Vector2,\n    number | Node<\"float\"> | Node<\"uint\">\n], import(\"three/webgpu\").VarNode<\"vec3\", V3>>;\nexport declare const stemTurnNode: import(\"three/tsl\").FnNode<[\n    Node<\"vec3\"> | import(\"three\").Vector3,\n    Node<\"vec4\"> | import(\"three\").Vector4\n], Node<\"vec2\">>;\nexport declare function stemVertex(o: {\n    field: FieldReader;\n    at: V2;\n    local: V3;\n    normal: V3;\n    height: F;\n    knobs: V4;\n    seed: V2;\n    time: F;\n    calm?: F | number;\n}): {\n    position: V3;\n    normal: V3;\n};\nexport declare const STEM_VEHICLE: 3;\nexport {};"
        },
        {
          "file": "sticky-pool.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node, UniformNode } from 'three/webgpu';\nimport { StickyField, type StickyLook, type StickyPusher, type StickyShape } from './sticky';\ntype F = Node<'float'>;\ntype V2 = Node<'vec2'>;\ntype V3 = Node<'vec3'>;\nexport declare const STICKY_FILM = 0.012;\nexport declare function stickyLift(dent: number, depth: number, rim: number): number;\nexport declare const stickyLiftNode: THREE.TSL.FnNode<[\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">,\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">,\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">\n], THREE.Node<\"float\">>;\nexport declare class StickyPool {\n    readonly field: StickyField;\n    readonly texture: THREE.DataTexture;\n    readonly square: THREE.UniformNode<\"vec4\", THREE.Vector4>;\n    constructor(shape: StickyShape);\n    update(dt: number, pushers: ReadonlyArray<StickyPusher>): void;\n    upload(): void;\n    setThickness(thickness: number): void;\n    clear(): void;\n    dentAt(xz: V2): F;\n    surface(xz: V2, depthAt: (xz: V2) => F, rim: F | number): {\n        lift: F;\n        slope: V2;\n        dent: F;\n    };\n    dispose(): void;\n}\nexport type StickyLookUniforms = {\n    deep: UniformNode<'color', THREE.Color>;\n    thin: UniformNode<'color', THREE.Color>;\n    film: UniformNode<'color', THREE.Color>;\n    gloss: UniformNode<'float', number>;\n    glow: UniformNode<'float', number>;\n    grain: UniformNode<'float', number>;\n    lumps: UniformNode<'float', number>;\n    set(look: StickyLook): void;\n};\nexport declare function stickyLookUniforms(look: StickyLook): StickyLookUniforms;\nexport declare function stickyShade(o: {\n    xz: V2;\n    dent: F;\n    slope: V2;\n    share: F;\n    look: StickyLookUniforms;\n}): {\n    colour: V3;\n    normal: V3;\n    roughness: F;\n    thin: THREE.Node<\"float\">;\n    through: THREE.Node<\"float\">;\n    grain: F;\n};\nexport {};"
        },
        {
          "file": "sticky.ts",
          "declarations": "import type { Pusher } from './touch-core';\nexport declare const TROUGH: {\n    readonly reach: 1.9;\n};\nexport declare const STICKY_CLOSE: {\n    readonly least: 0.8;\n    readonly most: 9;\n};\nexport declare function closeSeconds(thickness: number): number;\nexport declare const rimShare: (thickness: number) => number;\nexport type Knob = {\n    label: string;\n    hint: string;\n    min: number;\n    max: number;\n    step: number;\n    unit: string;\n};\nexport declare const STICKY_KNOBS: Record<'thickness', Knob>;\ntype RGB = readonly [\n    number,\n    number,\n    number\n];\nexport type StickyLook = {\n    deep: RGB;\n    thin: RGB;\n    film: RGB;\n    gloss: number;\n    glow: number;\n    grain: number;\n    lumps: number;\n};\nexport type StickyPreset = {\n    label: string;\n    thickness: number;\n    look: StickyLook;\n};\nexport type StickyPresetId = 'mud' | 'slush' | 'honey';\nexport declare const STICKY_PRESETS: Record<StickyPresetId, StickyPreset>;\nexport type StickyShape = {\n    x: number;\n    z: number;\n    sizeX: number;\n    sizeZ: number;\n    perMetre?: number;\n    thickness?: number;\n};\nexport type StickyPusher = Pusher & {\n    id?: string;\n};\nexport declare class StickyField {\n    readonly nx: number;\n    readonly nz: number;\n    readonly cell: number;\n    readonly x0: number;\n    readonly z0: number;\n    readonly values: Float32Array;\n    readonly bytes: Uint8Array;\n    dirty: boolean;\n    constructor(shape: StickyShape);\n    get active(): boolean;\n    get closing(): number;\n    setThickness(thickness: number): void;\n    at(x: number, z: number): number;\n    push(x: number, z: number, radius: number, strength?: number, from?: {\n        x: number;\n        z: number;\n    }): void;\n    press(pushers: ReadonlyArray<StickyPusher>): void;\n    step(dt: number): void;\n    write(): void;\n    clear(): void;\n}\nexport declare const PRINT: {\n    readonly stride: 0.42;\n    readonly keep: 0.62;\n    readonly least: 0.06;\n    readonly side: 0.1;\n};\nexport type PrintCoat = {\n    liquid: string;\n    coat: number;\n    x: number;\n    z: number;\n    walked: number;\n    left: boolean;\n};\nexport type Print = {\n    x: number;\n    z: number;\n    yaw: number;\n    strength: number;\n    liquid: string;\n};\nexport declare function stepCoat(coat: PrintCoat | null, x: number, z: number, inLiquid: string | null): {\n    coat: PrintCoat | null;\n    print: Print | null;\n};\nexport {};"
        },
        {
          "file": "touch-field.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\nimport { TouchCore, type Pusher, type TouchCoreOptions } from './touch-core';\ntype F = Node<'float'>;\ntype V2 = Node<'vec2'>;\ntype V4 = Node<'vec4'>;\ntype B = Node<'bool'>;\nexport declare const ringSlotNode: THREE.TSL.FnNode<[\n    THREE.Node<\"vec2\"> | THREE.Vector2,\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">\n], THREE.Node<\"vec2\">>;\nexport declare const ringSlotCpu: (cell: number, size: number, quotientError?: number) => number;\nexport type FieldReader = {\n    at: (xz: V2) => V4;\n    trail: (xz: V2) => V2;\n    near: (xz: V2, margin: F | number) => B;\n    time: F;\n};\nexport declare class TouchField implements FieldReader {\n    readonly core: TouchCore;\n    readonly texture: THREE.DataTexture;\n    readonly trailTexture: THREE.DataTexture;\n    readonly trailSeconds: THREE.UniformNode<\"float\", number>;\n    readonly clock: THREE.UniformNode<\"float\", number>;\n    constructor(options?: TouchCoreOptions);\n    get time(): F;\n    get size(): number;\n    get cell(): number;\n    update(renderer: THREE.WebGPURenderer | null, dt: number, pushers: ReadonlyArray<Pusher>, focus?: {\n        x: number;\n        z: number;\n    }): void;\n    upload(renderer: THREE.WebGPURenderer | null): void;\n    clear(renderer?: THREE.WebGPURenderer | null): void;\n    at(xz: V2): V4;\n    trail(xz: V2): V2;\n    near(xz: V2, margin: F | number): B;\n    get centre(): V2;\n    dispose(): void;\n}\nexport {};"
        },
        {
          "file": "wade.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\ntype V2 = Node<'vec2'>;\ntype V3 = Node<'vec3'>;\nexport declare const WADE: {\n    readonly drops: 40;\n    readonly speed: 0.7;\n    readonly wavelength: 0.28;\n    readonly width: 0.16;\n    readonly widen: 0.1;\n    readonly life: 3.6;\n    readonly fade: 1.3;\n};\nexport type WaterSample = readonly [\n    number,\n    number,\n    number\n];\nexport declare function ringAt(r: number, age: number, amp: number): readonly [\n    number,\n    number\n];\nexport declare class WadeField {\n    readonly drops: THREE.Vector4[];\n    readonly clock: THREE.UniformNode<\"float\", number>;\n    constructor(count?: number);\n    get now(): number;\n    splash(x: number, z: number, amp: number): void;\n    wade(id: string, x: number, z: number, radius: number, stir: number, wet: boolean): void;\n    update(dt: number): void;\n    clear(): void;\n    sample(x: number, z: number, now?: number): WaterSample;\n    ringsNode(xz: V2): V3;\n}\nexport {};"
        }
      ],
      "pitfalls": [
        "Turn a plant, never shear it",
        "The ring’s addressing: a world cell lives in slot (i mod size, j mod size)",
        "A plant outside the field reads nothing, and a cell that leaves the window is forgotten",
        "Keep each CPU twin and its node in step",
        "Low leaves stop at the ground",
        "A pad must never pass through the walker",
        "Cap how far a vehicle lays a plant over",
        "Keep the ring’s size even (TouchCore rounds it)",
        "On three’s WebGL2 backend, set pixel-store values through its own state",
        "Upload only the rows written",
        "The field’s clock is single precision, as the texture and the shaders hold it",
        "Normals turn with the plant through a varying worked out in the vertex stage",
        "The field is flat: it knows where something presses, not how high",
        "A thick liquid keeps a field of its own per pool, not the touch field",
        "Hand a pool what touches the liquid, not the size the touch field parts plants with",
        "Give a pool’s pushers an `id`",
        "Never cut a pool’s top to its floor",
        "A pool’s depth comes from the floor under it",
        "A pool asleep does nothing"
      ],
      "card": "entries/brush-through.json"
    },
    {
      "id": "brush-tips",
      "aliases": [],
      "name": "Brush tips with world-anchored patterns",
      "summary": "Five brush tips as pure functions of a point: a soft circle, a square that turns, a ragged edge that tears, a mottled cloud and a speckle of spots. The patterned three read their pattern at the point’s place on the canvas, not its place in the dab, so a drag lays the same holes and spots wherever its dabs overlap instead of smearing them into streaks: the edge reads as a texture, not as a brush. With a boundless tiled raster that dabs across tile borders, evenly spaced dabs with pen pressure, undo per stroke, and swatches drawn from the tips themselves.",
      "category": "canvas",
      "role": "interaction",
      "stack": [
        "canvas2d",
        "dom"
      ],
      "character": "calm",
      "tags": [
        "brush",
        "brush tip",
        "painting",
        "stamp",
        "dab",
        "pattern",
        "world space",
        "texture",
        "noise",
        "value noise",
        "pen pressure",
        "pointer events",
        "stylus",
        "tiles",
        "infinite canvas",
        "pan and zoom",
        "undo",
        "terrain painting",
        "no dependencies"
      ],
      "useCases": [
        "a paint or sketch tool on the web",
        "terrain, splat-map and ground-material painting in a level editor",
        "masks with torn or speckled edges (dirt, wear, gravel)",
        "brushes in a map or diagram editor",
        "a preview under the pointer that matches the dab exactly"
      ],
      "interaction": "Paint with a mouse, a finger or a pen · two fingers or the middle button pan · click, then the wheel zooms · 1–5 tips",
      "kits": [],
      "pairsWith": [
        {
          "id": "ink-strokes",
          "why": "Smoothed, pressure-widened paths to stamp along"
        },
        {
          "id": "infinite-canvas",
          "why": "A zoomable board to paint on"
        },
        {
          "id": "pixel-art-layer",
          "why": "Dabs turned into true pixel art"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "canvas2d",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": null,
          "cpuMs": 1.165,
          "cpuP95Ms": 5.01,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 30.862,
            "p99Ms": 32.195,
            "low1Fps": 30.9
          },
          "notes": "Measured painting by itself: a looping stroke laid at about 25 dabs a frame, cycling through the five tips every 3 s, while the view pans and zooms slowly; the canvas is cleared when it reaches 60 tiles. Idle, nothing is drawn."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.68,
          "cpuP95Ms": 1.155,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 262 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 1.62,
          "cpuP95Ms": 2.24,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 205 ms."
        }
      ],
      "signatures": [
        {
          "file": "brush-tips.ts",
          "declarations": "export type BrushTip = 'circle' | 'square' | 'ragged' | 'cloud' | 'speckle';\nexport declare const BRUSH_TIPS: ReadonlyArray<{\n    id: BrushTip;\n    label: string;\n    hint: string;\n}>;\nexport interface BrushShape {\n    radius: number;\n    hardness: number;\n    tip?: BrushTip;\n    angle?: number;\n    patternRadius?: number;\n}\nexport declare const TIP_ANGLE: {\n    readonly min: 0;\n    readonly max: number;\n    readonly step: number;\n    readonly recommended: 0;\n};\nexport declare const dabShape: ({ radius, falloff, tip, angle }: {\n    radius: number;\n    falloff: number;\n    tip?: BrushTip;\n    angle?: number;\n}) => BrushShape;\nexport declare const PATTERN_SIZE = 128;\nexport type BrushPattern = 'noise' | 'dots';\nexport declare function tipPattern(tip: BrushTip | undefined): BrushPattern | null;\nexport declare function patternScale(tip: BrushTip | undefined, radius: number): number;\nexport declare function brushReach(shape: BrushShape): number;\nexport declare function brushWeight(distance: number, shape: Pick<BrushShape, 'radius' | 'hardness'>): number;\nexport declare const RAGGED_BAND = 0.12;\nexport declare function brushInfluence(shape: BrushShape, cx: number, cz: number, x: number, z: number): number;\nexport declare function tipImage(shape: BrushShape, pixels: number): Uint8ClampedArray<ArrayBuffer>;\nexport declare function patternData(pattern: BrushPattern): Uint8Array<ArrayBufferLike>;\nexport declare function samplePattern(pattern: BrushPattern, x: number, z: number, scale: number): number;"
        },
        {
          "file": "paint-tiles.ts",
          "declarations": "import { type BrushShape } from './brush-tips';\nexport type Ink = {\n    r: number;\n    g: number;\n    b: number;\n};\nexport type Influence = (shape: BrushShape, cx: number, cy: number, x: number, y: number) => number;\nexport type DabOptions = {\n    erase?: boolean;\n    influence?: Influence;\n};\nexport type Tile = {\n    tx: number;\n    ty: number;\n    data: Uint8ClampedArray;\n    dirty: {\n        x0: number;\n        y0: number;\n        x1: number;\n        y1: number;\n    } | null;\n    version: number;\n};\nexport type StrokeUndo = Array<{\n    tx: number;\n    ty: number;\n    before: Uint8ClampedArray | null;\n}>;\nexport declare class PaintTiles {\n    readonly size: number;\n    readonly texel: number;\n    constructor(size?: number, texel?: number);\n    get span(): number;\n    get count(): number;\n    tile(tx: number, ty: number): Tile | undefined;\n    all(): IterableIterator<Tile>;\n    within(x0: number, y0: number, x1: number, y1: number): Generator<Tile>;\n    dab(cx: number, cy: number, shape: BrushShape, ink: Ink, flow: number, options?: DabOptions): number;\n    beginStroke(): void;\n    endStroke(): StrokeUndo | null;\n    undo(step: StrokeUndo): void;\n    takeDirty(tile: Tile): {\n        x0: number;\n        y0: number;\n        x1: number;\n        y1: number;\n    } | null;\n    clear(): void;\n    at(x: number, y: number): [\n        number,\n        number,\n        number,\n        number\n    ];\n}"
        },
        {
          "file": "stroke.ts",
          "declarations": "export type StrokePoint = {\n    x: number;\n    y: number;\n    pressure: number;\n};\nexport type StrokeOptions = {\n    spacing: (pressure: number) => number;\n    dab: (x: number, y: number, pressure: number) => void;\n};\nexport declare class StrokeSpacer {\n    dabs: number;\n    constructor(options: StrokeOptions);\n    get active(): boolean;\n    begin(x: number, y: number, pressure: number): void;\n    to(x: number, y: number, pressure: number): void;\n    end(): void;\n}"
        },
        {
          "file": "tile-canvas.ts",
          "declarations": "import { type BrushShape, type BrushTip } from './brush-tips';\nimport type { PaintTiles } from './paint-tiles';\nexport type View = {\n    x: number;\n    y: number;\n    zoom: number;\n};\nexport declare class TileCanvases {\n    constructor(tiles: PaintTiles);\n    draw(ctx: CanvasRenderingContext2D, view: View, width: number, height: number, dpr?: number): void;\n    dispose(): void;\n}\nexport declare function drawTipSwatch(canvas: HTMLCanvasElement, shape: BrushShape, pixels: number, colour?: string): void;\nexport declare function patternFill(ctx: CanvasRenderingContext2D, tip: BrushTip, radius: number, view: View, colour: string): CanvasPattern | null;"
        }
      ],
      "pitfalls": [
        "The pattern must be sampled at the world point, not at the offset from the dab’s centre",
        "Size the pattern from the brush’s set size (patternRadius), not from each dab’s",
        "The pattern is sized by the brush (patternScale)",
        "Ragged tears where the falloff is weak, so a hard ragged brush",
        "Evaluate a dab once per tile it overlaps, in world coordinates",
        "A preview under the pointer should call the same brushInfluence",
        "Space dabs along the path by distance (a share of the radius), not one per pointer event",
        "Mouse buttons report a pressure of 0.5 while pressed and many touch screens 0 or 1",
        "A strokeâ€™s undo is the tiles as they were at its first dab",
        "End a stroke on lostpointercapture as well as pointerup and pointercancel",
        "patternData builds both patterns on first use (two 128 × 128 passes, a few milliseconds)"
      ],
      "card": "entries/brush-tips.json"
    },
    {
      "id": "camera-director",
      "aliases": [],
      "name": "Camera director",
      "summary": "Cinematic camera moves between stations in a 3D world, with shots as data: target, eye, field of view, roll and an off-axis lens shift that puts the subject in the safe area beside your text, so a 32:9 wall frames like a 16:9 screen. Moves by critically damped springs, authored paths (centripetal Catmull–Rom walked by distance, speed profiles, look-ahead), fly-over arcs, cuts and dissolves; an endless hold drift; the viewer’s orbit on top; an effect speed. Shot lists too: move generators (push-in, orbit, crane, track, cut), start and end set from the view, cues reordered by dragging, play from the cursor without replaying earlier effects, scrub that samples the camera only, and the path checked against box proxies with a one-step “Fix it”. Deterministic, frame-rate independent, next to no garbage per frame, and at rest when nothing moves.",
      "category": "technique",
      "role": "system",
      "stack": [
        "three",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "camera",
        "cinematic",
        "shots",
        "stations",
        "springs",
        "critically damped",
        "catmull-rom",
        "camera path",
        "fly-over",
        "lens shift",
        "off-axis projection",
        "safe area",
        "framing",
        "ultra-wide",
        "led wall",
        "reduced motion",
        "deterministic",
        "shot list",
        "timeline",
        "scrub",
        "push-in",
        "orbit",
        "crane",
        "tracking shot",
        "camera collision",
        "box proxies",
        "three.js",
        "no dependencies"
      ],
      "useCases": [
        "live stage shows travelling one 3D world",
        "story stations and guided tours of a model or a map",
        "product showcases with text beside the subject",
        "title and splash camera moves",
        "cutscenes and attract loops",
        "framing a subject for any screen shape, from a phone to a 32:9 wall",
        "authoring camera moves for a cinematic or a show, on a timeline",
        "checking that a camera path never passes through the set"
      ],
      "interaction": "Page Up/Down or the numbers to travel · drag to look around · Shot list: scrub, drag cues, then Fix it",
      "kits": [
        {
          "kit": "product-presentation",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "world-pinned-labels",
          "why": "Labels that follow the subject between shots"
        },
        {
          "id": "keyframe-timeline",
          "why": "Shots placed and scrubbed on a timeline"
        },
        {
          "id": "post-stack",
          "why": "A grade and bloom for the framed shots"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 0.285,
          "cpuMs": 0.33,
          "cpuP95Ms": 0.63,
          "badge": "light",
          "drawCalls": 26,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured touring by itself: a cue every 2.5 s after arrival (fly-over, path with look-ahead, spring, path), the slow orbit drift while holding, the 16:9 frame letterboxed in the stage. The director itself is a few microseconds; the frame is the small world drawn."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.245,
          "cpuMs": 0.39,
          "cpuP95Ms": 0.51,
          "badge": "moderate",
          "drawCalls": 26,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 369 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 1.091,
          "cpuMs": 0.1,
          "cpuP95Ms": 0.14,
          "badge": "moderate",
          "drawCalls": 26,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 641 ms."
        }
      ],
      "signatures": [
        {
          "file": "camera-director.ts",
          "declarations": "import { type Drift } from './drift';\nimport { type Rect } from './framing';\nimport { type Pose, type Vec3 } from './lens';\nimport { type Ease } from './path';\nexport type Shot = {\n    target?: Vec3;\n    position?: Vec3;\n    yaw?: number;\n    pitch?: number;\n    distance?: number;\n    fov?: number;\n    roll?: number;\n    frame?: 'safe' | 'centre' | Rect;\n    fit?: ReadonlyArray<Vec3> | {\n        center: Vec3;\n        radius: number;\n    };\n    padding?: number;\n    move?: Move;\n};\nexport type Move = {\n    kind: 'spring';\n    settle?: number;\n} | {\n    kind: 'path';\n    via?: ReadonlyArray<Vec3>;\n    lookVia?: ReadonlyArray<Vec3>;\n    duration?: number;\n    ease?: Ease;\n    lookAhead?: number;\n} | {\n    kind: 'flyover';\n    lift?: number;\n    duration?: number;\n    ease?: Ease;\n} | {\n    kind: 'cut';\n} | {\n    kind: 'dissolve';\n    duration?: number;\n};\nexport type OrbitOptions = {\n    yaw?: number;\n    pitch?: [\n        number,\n        number\n    ];\n    distance?: [\n        number,\n        number\n    ];\n    returnAfter?: number;\n    settle?: number;\n};\nexport type DirectorOptions = {\n    shots?: Record<string, Shot>;\n    start: Shot | string;\n    aspect?: number;\n    safe?: Rect;\n    move?: Move;\n    fov?: number;\n    settle?: number;\n    speed?: number;\n    drift?: Drift | null;\n    orbit?: OrbitOptions | false;\n    reducedMotion?: boolean;\n    dissolve?: number;\n    onArrive?(id: string | null): void;\n};\nexport type Phase = 'moving' | 'holding' | 'resting';\nexport type CameraDirector = {\n    readonly pose: Readonly<Pose>;\n    readonly phase: Phase;\n    readonly progress: number;\n    readonly moving: Move['kind'] | null;\n    readonly veil: number;\n    readonly current: string | null;\n    speed: number;\n    reducedMotion: boolean;\n    go(shot: Shot | string, move?: Move): void;\n    update(dt: number): boolean;\n    setView(view: {\n        aspect?: number;\n        safe?: Rect;\n    }): void;\n    setDrift(drift: Drift | null): void;\n    orbitBy(yaw: number, pitch: number): void;\n    zoomBy(factor: number): void;\n    resetOrbit(): void;\n    poseOf(shot: Shot | string, out?: Pose): Pose;\n};\nexport declare function createCameraDirector(options: DirectorOptions): CameraDirector;"
        },
        {
          "file": "collision.ts",
          "declarations": "import { type CameraDirector, type Move, type Shot } from './camera-director';\nimport type { Rect } from './framing';\nimport type { Vec3 } from './lens';\nexport type Box = {\n    min: Vec3;\n    max: Vec3;\n    name?: string;\n};\nexport type Leg = {\n    start?: Shot;\n    shot: Shot;\n    move?: Move;\n    hold?: number;\n};\nexport type TraceOptions = {\n    aspect?: number;\n    safe?: Rect;\n    fov?: number;\n    settle?: number;\n    from?: Shot;\n    step?: number;\n    maxLeg?: number;\n};\nexport type TraceSample = {\n    eye: Vec3;\n    leg: number;\n    time: number;\n    jump: boolean;\n};\nexport type PathHit = {\n    leg: number;\n    time: number;\n    eye: Vec3;\n    box: Box;\n};\nexport type Raise = {\n    leg: number;\n    part: 'start' | 'end' | 'via';\n    rise: number;\n    box: Box;\n};\nexport declare function hitBox(p: Readonly<Vec3>, boxes: ReadonlyArray<Box>, pad?: number): Box | null;\nexport declare function segmentEnters(a: Readonly<Vec3>, b: Readonly<Vec3>, box: Box, pad?: number): number | null;\nexport declare function traceLegs(legs: ReadonlyArray<Leg>, options?: TraceOptions): TraceSample[];\nexport declare function checkTrace(samples: ReadonlyArray<TraceSample>, boxes: ReadonlyArray<Box>, pad?: number): PathHit[];\nexport declare function findHits(legs: ReadonlyArray<Leg>, boxes: ReadonlyArray<Box>, options?: TraceOptions & {\n    pad?: number;\n}): PathHit[];\nexport declare function raiseShot(shot: Shot, rise: number, director: CameraDirector): Shot | null;\nexport type FixResult = {\n    legs: Leg[];\n    raised: Raise[];\n    clear: boolean;\n};\nexport declare function fixLegs(legs: ReadonlyArray<Leg>, boxes: ReadonlyArray<Box>, options?: TraceOptions & {\n    pad?: number;\n    maxSteps?: number;\n}): FixResult;"
        },
        {
          "file": "framing.ts",
          "declarations": "import { type Vec3 } from './lens';\nexport type Rect = {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n};\nexport declare const FULL: Readonly<Rect>;\nexport type PanelSide = 'left' | 'right' | 'top' | 'bottom';\nexport type SafeAreaOptions = {\n    panel?: {\n        side: PanelSide;\n        size: number;\n    } | null;\n    margin?: number;\n    maxAspect?: number;\n};\nexport declare function safeArea(aspect: number, options?: SafeAreaOptions): {\n    safe: Rect;\n    panel: Rect | null;\n};\nexport declare function lensFor(rect: Readonly<Rect>, out?: [\n    number,\n    number\n]): [\n    number,\n    number\n];\nexport type FitOptions = {\n    yaw: number;\n    pitch: number;\n    roll?: number;\n    fov: number;\n    aspect: number;\n    rect?: Readonly<Rect>;\n    padding?: number;\n};\nexport type Fit = {\n    target: Vec3;\n    distance: number;\n};\nexport declare function fitPoints(points: ReadonlyArray<Readonly<Vec3>>, o: FitOptions): Fit;\nexport declare function fitSphere(center: Readonly<Vec3>, radius: number, o: Omit<FitOptions, 'yaw' | 'pitch' | 'roll'>): Fit;\nexport declare function boxCorners(min: Readonly<Vec3>, max: Readonly<Vec3>): Vec3[];"
        },
        {
          "file": "lens.ts",
          "declarations": "export type Vec3 = [\n    number,\n    number,\n    number\n];\nexport type Pose = {\n    eye: Vec3;\n    target: Vec3;\n    fov: number;\n    roll: number;\n    lens: [\n        number,\n        number\n    ];\n};\nexport type Axes = {\n    right: Vec3;\n    up: Vec3;\n    forward: Vec3;\n};\nexport declare const DEG: number;\nexport declare function createPose(): Pose;\nexport declare function createAxes(): Axes;\nexport declare function orbitEye(out: Vec3, target: Readonly<Vec3>, yaw: number, pitch: number, distance: number): Vec3;\nexport type Orbit = {\n    yaw: number;\n    pitch: number;\n    distance: number;\n};\nexport declare function orbitOf(eye: Readonly<Vec3>, target: Readonly<Vec3>, out?: Orbit): Orbit;\nexport declare function axes(out: Axes, eye: Readonly<Vec3>, target: Readonly<Vec3>, roll?: number): Axes;\nexport declare function viewMatrix(out: Float32Array | Float64Array | number[], pose: Readonly<Pose>): typeof out;\nexport declare function projectionMatrix(out: Float32Array | Float64Array | number[], pose: Readonly<Pose>, aspect: number, near: number, far: number, depth?: 'zero-to-one' | 'minus-one-to-one'): typeof out;\nexport declare function projectPoint(out: Vec3, pose: Readonly<Pose>, aspect: number, p: Readonly<Vec3>): Vec3;"
        },
        {
          "file": "orbit-input.ts",
          "declarations": "import type { CameraDirector } from './camera-director';\nexport type OrbitInputOptions = {\n    sensitivity?: number;\n    wheel?: boolean;\n    keyboard?: boolean;\n    ignore?(target: Element): boolean;\n    onInput?(): void;\n};\nexport declare function attachOrbitInput(el: HTMLElement, director: CameraDirector, options?: OrbitInputOptions): () => void;"
        },
        {
          "file": "sequence-player.ts",
          "declarations": "import type { CameraDirector } from './camera-director';\nimport { type CameraCue, type EffectCue, type Sequence } from './sequence';\nexport type SequencePlayerOptions = {\n    sequence: Sequence;\n    onEffect?(cue: EffectCue): void;\n    onShot?(cue: CameraCue): void;\n    onEnd?(): void;\n};\nexport type SequencePlayer = {\n    sequence: Sequence;\n    readonly time: number;\n    readonly playing: boolean;\n    readonly length: number;\n    readonly shot: {\n        shot: number;\n        cue: number;\n        time: number;\n    };\n    seek(time: number): void;\n    play(from?: number): void;\n    pause(): void;\n    update(dt: number): boolean;\n};\nexport declare function createSequencePlayer(director: CameraDirector, options: SequencePlayerOptions): SequencePlayer;"
        },
        {
          "file": "sequence.ts",
          "declarations": "import type { Move, Shot } from './camera-director';\nimport { type Box, type Leg, type PathHit, type TraceOptions } from './collision';\nimport type { Vec3 } from './lens';\nexport type ShotKind = 'authored' | 'push-in' | 'orbit' | 'crane' | 'track' | 'cut';\nexport type EaseName = 'cruise' | 'smooth' | 'inOut' | 'linear' | 'out';\nexport type ShotMove = {\n    kind: 'path';\n    via?: Vec3[];\n    lookVia?: Vec3[];\n    lookAhead?: number;\n} | {\n    kind: 'flyover';\n    lift?: number;\n} | {\n    kind: 'spring';\n} | {\n    kind: 'dissolve';\n} | {\n    kind: 'cut';\n};\nexport type SequenceShot = {\n    name: string;\n    start?: Shot;\n    end: Shot;\n    move: ShotMove;\n    duration: number;\n    ease?: EaseName;\n    kind: ShotKind;\n};\nexport type Cue = {\n    id: string;\n    at: number;\n    label: string;\n} & ({\n    do: 'camera';\n    shot: number;\n} | {\n    do: 'effect';\n    name: string;\n});\nexport type CameraCue = Cue & {\n    do: 'camera';\n};\nexport type EffectCue = Cue & {\n    do: 'effect';\n};\nexport type Sequence = {\n    shots: SequenceShot[];\n    cues: Cue[];\n};\nexport type ViewFrame = {\n    eye: Readonly<Vec3>;\n    target: Readonly<Vec3>;\n    fov: number;\n    roll?: number;\n};\nexport declare const boundedTime: (n: number) => number;\nexport declare const cueLength: (seq: Sequence, cue: Cue) => number;\nexport declare const sequenceLength: (seq: Sequence) => number;\nexport declare const cueId: () => string;\nexport declare function createSequence(shots: ReadonlyArray<SequenceShot>, order?: ReadonlyArray<number>, makeId?: () => string): Sequence;\nexport declare function moveCue(seq: Sequence, index: number, at: number): Sequence;\nexport declare function duplicateShot(seq: Sequence, index: number, makeId?: () => string): {\n    sequence: Sequence;\n    cue: string;\n};\nexport declare function removeShot(seq: Sequence, index: number): Sequence;\nexport declare function setFrame(shot: SequenceShot, edge: 'start' | 'end', view: ViewFrame): SequenceShot;\nexport type MoveOptions = {\n    amount?: number;\n    sweep?: number;\n    rise?: number;\n    track?: ReadonlyArray<Readonly<Vec3>>;\n};\nexport declare function makeMove(shot: SequenceShot, kind: Exclude<ShotKind, 'authored'>, from: ViewFrame, options?: MoveOptions): SequenceShot;\nexport declare function moveOf(shot: SequenceShot): Move;\nexport declare const cameraCues: (seq: Sequence) => Array<{\n    cue: CameraCue;\n    index: number;\n}>;\nexport declare function cameraAt(seq: Sequence, time: number): {\n    shot: number;\n    cue: number;\n    time: number;\n};\nexport declare function playbackSlice(seq: Sequence, from: number): Cue[];\nexport declare function legsOf(seq: Sequence): {\n    legs: Leg[];\n    cues: number[];\n};\nexport type SequenceHit = PathHit & {\n    cue: number;\n    shot: number;\n    at: number;\n};\nexport declare function checkSequence(seq: Sequence, boxes: ReadonlyArray<Box>, options?: TraceOptions & {\n    pad?: number;\n}): SequenceHit[];\nexport type SequenceFix = {\n    sequence: Sequence;\n    raised: Array<{\n        shot: number;\n        part: 'start' | 'end' | 'via';\n        rise: number;\n        box: Box;\n    }>;\n    clear: boolean;\n};\nexport declare function fixSequence(seq: Sequence, boxes: ReadonlyArray<Box>, options?: TraceOptions & {\n    pad?: number;\n    maxSteps?: number;\n}): SequenceFix;\nexport declare function parseSequence(value: unknown): Sequence;"
        },
        {
          "file": "three-camera.ts",
          "declarations": "import type { PerspectiveCamera } from 'three';\nimport type { Pose } from './lens';\nexport declare function applyPose(camera: PerspectiveCamera, pose: Readonly<Pose>, aspect?: number): void;"
        }
      ],
      "pitfalls": [
        "Apply the pose after anything that rebuilds the projection",
        "The lens is in the projection, so anything that rebuilds a projection from fov and aspect alone",
        "Raw WebGPU wants depth 0..1 and WebGL -1..1",
        "Give the director the screen’s real shape and safe area (setView) on every resize",
        "Fitting depends on the field of view and the screen",
        "Durations, settle times and the drift are in seconds of show time",
        "Keep pitch away from ±90°",
        "A dissolve only gives you its veil (0..1)",
        "update() returns false when nothing changed",
        "Paths are made once per go()",
        "While a sequence player owns a director, call player.update(dt) and not director.update(dt)",
        "Paused or scrubbing, the player holds the camera at the cursor’s pose",
        "A shot with a start cuts to it when its cue comes",
        "Box proxies are axis-aligned and grown by `pad` (default 0.6 world units) on every side",
        "Fix it only raises cameras (framings, or a path’s waypoints)",
        "Eases in a sequence are names (it saves as JSON) and the director gets the functions from…"
      ],
      "card": "entries/camera-director.json"
    },
    {
      "id": "canvas-controls",
      "aliases": [],
      "name": "Controls drawn on a canvas",
      "summary": "A slider drawn on a 2D canvas that feels like a real one: hit boxes recorded in the item’s own frame as it is drawn (turned and scaled cards too, with slack round a thin track), the thumb and its number drawn at the pointer at once while the value is written on a 60 ms throttle and once more on release, the whole drag one undo step, a range stored when the control is made (never recomputed from the value), and the words typed round the number kept. Real range inputs laid over the drawn controls give them the keyboard, names and one focus ring.",
      "category": "canvas",
      "role": "interaction",
      "stack": [
        "canvas2d",
        "dom"
      ],
      "character": "calm",
      "tags": [
        "canvas",
        "canvas 2d",
        "slider",
        "hit testing",
        "hit boxes",
        "rotation",
        "local frame",
        "throttle",
        "drag",
        "undo",
        "units",
        "accessibility",
        "proxy inputs",
        "no dependencies"
      ],
      "useCases": [
        "sliders and knobs on a whiteboard or board card",
        "what-if numbers on a canvas dashboard",
        "controls inside a game or a design tool’s canvas",
        "any value worked out elsewhere (a worker, a server) and shared with co-editors while it is dragged"
      ],
      "interaction": "Drag a thumb (the turned card too) · Tab to a slider and use the arrows · Ctrl Z undoes a whole drag · Esc mid-drag puts it back",
      "kits": [],
      "pairsWith": [
        {
          "id": "infinite-canvas",
          "why": "Controls on cards of a pannable, zoomable board"
        },
        {
          "id": "labelled-undo",
          "why": "Its hold() makes a whole drag one named step"
        },
        {
          "id": "steady-fields",
          "why": "The same slider rules in the DOM, and a number box beside it"
        },
        {
          "id": "smart-guides",
          "why": "Turned boxes and handles in the same local frames"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "canvas2d",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.59,
          "cpuP95Ms": 0.785,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.8,
            "p99Ms": 18,
            "low1Fps": 54.8
          },
          "notes": "Measured with a drag playing itself: each frame moves the Arrivals thumb (drawn at the pointer at once, written every 60 ms), the readout card eases toward what was written, and the whole board is drawn again on a 2D canvas with its hit boxes and stand-in inputs."
        }
      ],
      "signatures": [
        {
          "file": "canvas-controls.ts",
          "declarations": "import { type SliderRange } from './slider-math';\nimport { type SlideNumber } from './slide-number';\nexport type Vec = {\n    x: number;\n    y: number;\n};\nexport type Rect = {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n};\nexport type ItemFrame = {\n    x: number;\n    y: number;\n    rotation?: number;\n    scale?: number;\n};\nexport declare function frameMatrix(f: ItemFrame): [\n    number,\n    number,\n    number,\n    number,\n    number,\n    number\n];\nexport declare function toLocal(f: ItemFrame, p: Vec): Vec;\nexport declare function toBoard(f: ItemFrame, p: Vec): Vec;\nexport type Slack = {\n    x: number;\n    y: number;\n};\nexport declare const DEFAULT_SLACK: Slack;\nexport type HitBox<T> = {\n    rect: Rect;\n    slack: Slack;\n    data: T;\n};\nexport declare const hitArea: (b: {\n    rect: Rect;\n    slack: Slack;\n}) => Rect;\nexport declare class HitBoxes<T> {\n    begin(item: string): void;\n    add(item: string, rect: Rect, data: T, slack?: Partial<Slack>): void;\n    at(item: string, local: Vec): HitBox<T> | null;\n    atBoard(item: string, frame: ItemFrame, p: Vec): HitBox<T> | null;\n    of(item: string): readonly HitBox<T>[];\n    forget(item: string): void;\n}\nexport type CanvasSlider = {\n    id: string;\n    label: string;\n    text: string;\n    range: SliderRange;\n};\nexport declare function makeSlider(id: string, label: string, text: string, o?: {\n    range?: SliderRange;\n}): CanvasSlider | null;\nexport declare const sliderNumber: (c: CanvasSlider) => SlideNumber | null;\nexport declare const valueAt: (localX: number, track: Rect, range: SliderRange, rtl?: boolean) => number;\nexport declare const thumbAt: (value: number, track: Rect, range: SliderRange) => number;\nexport type HeldStep = {\n    close(): void;\n    cancel?(): void;\n};\nexport type SlideOptions = {\n    track: Rect;\n    range: SliderRange;\n    write: (n: number) => void;\n    every?: number;\n    hold?: () => HeldStep | void;\n    from?: number;\n    rtl?: boolean;\n};\nexport type SlideDrag = {\n    readonly shown: number;\n    readonly written: number | null;\n    readonly writes: number;\n    move(localX: number, now: number): number;\n    tick(now: number): boolean;\n    end(localX: number | null, now: number): void;\n    cancel(): void;\n    readonly done: boolean;\n};\nexport declare function startSlide(o: SlideOptions, localX: number, now: number): SlideDrag;"
        },
        {
          "file": "draw-slider.ts",
          "declarations": "import { type CanvasSlider, type HitBoxes, type Rect, type Slack } from './canvas-controls';\nexport type SliderHit = {\n    slider: CanvasSlider;\n    track: Rect;\n};\nexport type SliderPaint = {\n    text: string;\n    quiet: string;\n    rail: string;\n    fill: string;\n    face: string;\n    font: string;\n    figureFont: string;\n};\nexport type SliderRowOptions = {\n    value: number | null;\n    figure: string;\n    nameShare?: number;\n    trackShare?: number;\n    thickness?: number;\n    thumb?: number;\n    slack?: Partial<Slack>;\n    rtl?: boolean;\n};\nexport declare function fitText(ctx: CanvasRenderingContext2D, text: string, width: number): string;\nexport declare function drawSliderRow(ctx: CanvasRenderingContext2D, hits: HitBoxes<SliderHit>, item: string, slider: CanvasSlider, row: Rect, paint: SliderPaint, o: SliderRowOptions): void;"
        },
        {
          "file": "proxies.ts",
          "declarations": "import { type ItemFrame, type Rect } from './canvas-controls';\nimport { type SliderRange } from './slider-math';\nexport type ProxySlider = {\n    id: string;\n    label: string;\n    value: number;\n    range: SliderRange;\n    valueText: string;\n    frame: ItemFrame;\n    box: Rect;\n};\nexport type SliderProxiesOptions = {\n    onStep(id: string, value: number, how: 'key' | 'set'): void;\n    onKeyEnd?(id: string): void;\n    onFocus?(id: string | null): void;\n};\nexport type SliderProxies = {\n    sync(list: readonly ProxySlider[]): void;\n    focus(id: string, o?: {\n        pointer?: boolean;\n    }): void;\n    readonly focused: string | null;\n    readonly layer: HTMLElement;\n    dispose(): void;\n};\nexport declare function createSliderProxies(host: HTMLElement, o: SliderProxiesOptions): SliderProxies;"
        },
        {
          "file": "slide-number.ts",
          "declarations": "export type SlideNumber = {\n    before: string;\n    n: number;\n    after: string;\n    grouped?: boolean;\n};\nexport declare function readNumber(s: string): number | null;\nexport declare function slideNumber(input: string): SlideNumber | null;\nexport declare function withNumber(s: SlideNumber, n: number): string;"
        }
      ],
      "pitfalls": [
        "Record hit boxes while drawing, in the item’s own frame",
        "Give a thin track slack",
        "Draw the dragged value from the pointer, never from the store",
        "Call tick() every frame while dragging",
        "Hold one undo step open for the whole drag (hold() on start, close() on release)",
        "Set the range when the control is made and store it with the control",
        "Rewrite only the number in what was typed (withNumber)",
        "A canvas has no keyboard or names",
        "Draw the number in a column of its own, flush to its end"
      ],
      "card": "entries/canvas-controls.json"
    },
    {
      "id": "capability-tiers",
      "aliases": [],
      "name": "GPU capability tiers",
      "summary": "Decides how much a page may draw on this device: it probes WebGPU and its adapter, WebGL 2, memory, cores, data saver, battery and reduced motion, picks rich, light, WebGL or a still picture with its reasons written out, then times the first frames and steps down a tier (remembered) if they are slow. One WebGPU device for the whole app is asked for only at a tier that draws with WebGPU, and asked for again, from a new adapter, after it is lost.",
      "category": "systems",
      "role": "system",
      "stack": [
        "headless"
      ],
      "character": "calm",
      "tags": [
        "webgpu",
        "webgl",
        "feature detection",
        "adaptive quality",
        "fallback",
        "performance budget",
        "localStorage",
        "accessibility",
        "gpu device",
        "device lost",
        "shared device"
      ],
      "useCases": [
        "splash and intro animations",
        "hero scenes on landing pages",
        "3D viewers and configurators",
        "games picking a quality preset",
        "any effect that must not stutter on a weak laptop",
        "one GPU device shared by every effect in an app",
        "surviving a lost GPU device on phones"
      ],
      "interaction": "Simulate a weaker device or slow first frames in the controls, then replay the start-up · Lose it under One GPU device",
      "kits": [
        {
          "kit": "foundations",
          "as": "optional"
        },
        {
          "kit": "game",
          "as": "core"
        },
        {
          "kit": "product-presentation",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "dynamic-resolution",
          "why": "Holds the budget inside the tier it picked"
        },
        {
          "id": "compile-without-stalls",
          "why": "Builds only the pipelines the tier draws"
        },
        {
          "id": "gpu-page-runtime",
          "why": "One device and tier for every widget on the page"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "At most 1 canvas pixel per CSS px; the bench draws rich.",
          "low": "At most 0.75 canvas pixels per CSS px; the bench draws the light tier (600 motes, no light shafts)."
        },
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.80",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-03",
          "gpuMs": null,
          "cpuMs": 0.945,
          "cpuP95Ms": 1.145,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured at the rich tier whatever the device: 1,600 glowing motes, light shafts and the lens pass drawn with Canvas 2D every frame. The probes run once before the first frame and cost nothing per frame."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 1.955,
          "cpuP95Ms": 2.175,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 38 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.12,
          "cpuP95Ms": 0.18,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 130 ms."
        }
      ],
      "signatures": [
        {
          "file": "quality-tier.ts",
          "declarations": "export type QualityTier = 'high' | 'medium' | 'low';\nexport declare const QUALITY_TIERS: readonly QualityTier[];\nexport declare const QUALITY_NAMES: Record<QualityTier, string>;\nexport declare const isQualityTier: (v: unknown) => v is QualityTier;\nexport declare const lowerTier: (a: QualityTier, b: QualityTier) => QualityTier;\nexport type AdapterFacts = {\n    vendor: string;\n    architecture: string;\n    description?: string;\n    fallback?: boolean;\n};\nexport declare function adapterTier(a: AdapterFacts | null): {\n    tier: QualityTier;\n    reason: string;\n};\nexport declare const PROBE_REFERENCE_MS = 0.88;\nexport declare const PROBE_LIMITS: {\n    readonly high: 2.5;\n    readonly medium: 6;\n};\nexport declare function probeTier(ms: number): {\n    tier: QualityTier;\n    reason: string;\n};\nexport declare function chooseQualityTier(adapter: AdapterFacts | null, probeMs: number | null): {\n    tier: QualityTier;\n    reasons: string[];\n};\nexport declare function probeGpu(gpu?: GPU | undefined): Promise<number | null>;"
        },
        {
          "file": "shared-device.ts",
          "declarations": "import type { Tier, TierStore } from './tier';\nexport type SharedGpu = {\n    device: GPUDevice;\n    format: GPUTextureFormat;\n    tier: Tier;\n    generation: number;\n    adapter: string;\n};\nexport type SharedDeviceOptions = {\n    store: Pick<TierStore, 'sense' | 'resolveTier'>;\n    tiers?: readonly Tier[];\n    powerPreference?: GPUPowerPreference;\n    features?: readonly GPUFeatureName[];\n    gpu?: GPU | null;\n};\nexport type SharedDevice = {\n    get(): Promise<SharedGpu | null>;\n    current(): SharedGpu | null;\n    subscribe(fn: (gpu: SharedGpu | null, reason?: string) => void): () => void;\n    lose(): void;\n    retry(): void;\n    dispose(): void;\n};\nexport declare function createSharedDevice(options: SharedDeviceOptions): SharedDevice;"
        },
        {
          "file": "tier.ts",
          "declarations": "export type Tier = 'rich' | 'light' | 'webgl' | 'still';\nexport declare const TIER_NAMES: Record<Tier, string>;\nexport type Sense = {\n    webgpu: boolean;\n    adapter: null | {\n        fallback: boolean;\n        maxTexture: number;\n        maxStorage: number;\n        features: string[];\n        vendor: string;\n        architecture: string;\n        description: string;\n    };\n    webgl2: boolean;\n    memory: number | null;\n    cores: number | null;\n    reducedMotion: boolean;\n    saveData: boolean;\n    batterySaver: boolean;\n    remembered: Tier | null;\n};\nexport declare const TIERS: Tier[];\nexport declare function chooseTier(s: Sense): {\n    tier: Tier;\n    reasons: string[];\n};\nexport declare const SLOW_MS: {\n    readonly rich: 14;\n    readonly light: 24;\n};\nexport declare function judgeFrames(tier: Tier, gpuMs: readonly number[]): Tier | null;\nexport type TierChoice = 'auto' | Tier;\nexport type TierStore = {\n    sense(): Promise<Sense>;\n    tierChoice(): TierChoice;\n    setTierChoice(choice: TierChoice): void;\n    resolveTier(s: Sense, choice?: TierChoice): {\n        tier: Tier;\n        reasons: string[];\n        fixed: boolean;\n    };\n    rememberTier(tier: Tier | null): void;\n    remembered(): Tier | null;\n    readonly keys: {\n        tier: string;\n        choice: string;\n    };\n};\nexport declare function createTierStore({ storagePrefix }: {\n    storagePrefix: string;\n}): TierStore;\nexport declare function probe(): Promise<Omit<Sense, 'remembered'>>;"
        }
      ],
      "pitfalls": [
        "Judge GPU time, not frame time",
        "Skip the first frames: shaders compile and the page is still loading behind them",
        "A tier the viewer chose is never stepped down, and choosing one forgets the remembered downgrade",
        "navigator.deviceMemory, connection.saveData and getBattery are Chromium only",
        "requestAdapter can take a moment and getBattery much longer",
        "Reduced motion is not a lower tier",
        "The remembered downgrade never expires by itself",
        "One device for the app: a canvas configured with one device can’t draw another’s textures",
        "A lost device takes everything made on it",
        "An adapter hands out one device",
        "A “no device” at a tier without WebGPU is kept",
        "Measure a tier on the device it is for",
        "quality-tier.ts: an integrated GPU is told by its adapter’s architecture"
      ],
      "card": "entries/capability-tiers.json"
    },
    {
      "id": "card-material",
      "aliases": [],
      "name": "Procedural card material",
      "summary": "Real finishes on cards, tiles and panels from one lit surface and no textures: matte paper, satin, gloss, brushed metal, polished chrome, anodised, rose gold, copper, metal flake, candy, pearlescent, holographic foil, velvet, leather, rubber, ceramic enamel and carbon fibre are all the same TSL function with different numbers. surface() lights a point with GGX highlights, metalness and anisotropy (a brushed grain), a clearcoat with its own sharp reflection, fabric sheen at grazing angles, thin-film iridescence, glitter flakes that glint toward the light and a holographic rainbow that moves with the tilt, all reflecting a studio built from uniforms (a room, a horizon glow, soft boxes and strip lights) set from a light rig: studio, warehouse, sunset, night or overcast. About thirty procedural patterns (stripes, herringbone, hex, marble, carbon weave, wood, brick and more) can be printed on the face or pressed into it so their slopes catch the light, and flakes and streaks fade to their average before they are small enough to sparkle and crawl. The finish lives in uniforms, so switching it never builds a shader. The demo’s seven curved cards cost about 0.6 ms of GPU and 0.2 ms of CPU a frame at 1080p on a laptop RTX 4060. Use it for premium and trading cards, badges, product finish pickers and UI panels in real materials.",
      "category": "surface",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "balanced",
      "tags": [
        "pbr",
        "ggx",
        "clearcoat",
        "iridescence",
        "anisotropy",
        "glitter",
        "holographic",
        "tsl",
        "no textures"
      ],
      "useCases": [
        "premium cards and tiles",
        "trading cards and badges",
        "product and finish pickers",
        "UI panels with real materials",
        "logos in metal"
      ],
      "interaction": "Move the pointer over the stage: the cards tilt toward it",
      "kits": [
        {
          "kit": "product-presentation",
          "as": "optional"
        },
        {
          "kit": "shop",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "card-springs",
          "why": "Cards that lean and catch the light on their finish"
        },
        {
          "id": "material-designer",
          "why": "Build the finishes as recipes"
        },
        {
          "id": "thin-film",
          "why": "The physics behind its iridescent foil"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.80",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-04",
          "gpuMs": 0.581,
          "cpuMs": 0.195,
          "cpuP95Ms": 0.3,
          "badge": "moderate",
          "drawCalls": 15,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Seven curved cards, each a full lit surface (GGX with clearcoat, sheen, thin film, anisotropy, flakes and foil in one shader), the large one with a hex pattern pressed into it (three pattern samples a pixel for its slope), swaying slowly."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.704,
          "cpuMs": 0.55,
          "cpuP95Ms": 0.85,
          "badge": "moderate",
          "drawCalls": 15,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 213 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 5.848,
          "cpuMs": 0.5,
          "cpuP95Ms": 0.62,
          "badge": "heavy",
          "drawCalls": 15,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 280 ms."
        }
      ],
      "signatures": [
        {
          "file": "card-material.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Light } from './finishes';\ntype F = THREE.Node<'float'>;\ntype V2 = THREE.Node<'vec2'>;\ntype V3 = THREE.Node<'vec3'>;\nexport declare const hash21: THREE.TSL.FnNode<[\n    THREE.Node<\"vec2\"> | THREE.Vector2\n], THREE.Node<\"float\">>;\nexport declare const vnoise: THREE.TSL.FnNode<[\n    THREE.Node<\"vec2\"> | THREE.Vector2\n], THREE.Node<\"float\">>;\nexport declare const fbm: THREE.TSL.FnNode<[\n    THREE.Node<\"vec2\"> | THREE.Vector2\n], THREE.Node<\"float\">>;\nexport declare const pattern: THREE.TSL.FnNode<[\n    THREE.Node<\"vec2\"> | THREE.Vector2,\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">,\n    THREE.Node<\"vec2\"> | THREE.Vector2,\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">\n], THREE.Node<\"float\">>;\nexport declare class Surroundings {\n    readonly below: THREE.UniformNode<\"vec3\", THREE.Vector3>;\n    readonly above: THREE.UniformNode<\"vec3\", THREE.Vector3>;\n    readonly horizon: THREE.UniformNode<\"vec4\", THREE.Vector4>;\n    readonly lightA: THREE.UniformNode<\"vec3\", THREE.Vector3>;\n    readonly colourA: THREE.UniformNode<\"vec3\", THREE.Vector3>;\n    readonly lightB: THREE.UniformNode<\"vec3\", THREE.Vector3>;\n    readonly colourB: THREE.UniformNode<\"vec3\", THREE.Vector3>;\n    readonly strips: THREE.UniformNode<\"vec4\", THREE.Vector4>;\n    readonly keyColour: THREE.UniformNode<\"vec3\", THREE.Vector3>;\n    readonly fillColour: THREE.UniformNode<\"vec3\", THREE.Vector3>;\n    readonly rimColour: THREE.UniformNode<\"vec3\", THREE.Vector3>;\n    readonly rimDir: THREE.UniformNode<\"vec3\", THREE.Vector3>;\n    readonly keyPower: THREE.UniformNode<\"float\", number>;\n    set(light: Light): void;\n    readonly at: (r: V3, rough: F) => V3;\n}\nexport type SurfaceIn = {\n    albedo: V3;\n    n: V3;\n    v: V3;\n    l: V3;\n    metal: F;\n    rough: F;\n    clearcoat: F;\n    coatRough: F;\n    sheen: F;\n    sheenRough: F;\n    irid: F;\n    iridThick: F;\n    aniso: F;\n    anisoRot: F;\n    flake: F;\n    flakeSize: F;\n    flakePx: F;\n    holo: F;\n    intensity: F;\n    p: V2;\n    px: F;\n    env: Surroundings;\n};\nexport declare function surface(s: SurfaceIn): V3;\nexport {};"
        },
        {
          "file": "finishes.ts",
          "declarations": "export type Finish = 'none' | 'paper' | 'satin' | 'gloss' | 'brushed' | 'chrome' | 'anodised' | 'gunmetal' | 'rosegold' | 'copper' | 'flake' | 'candy' | 'pearl' | 'holo' | 'velvet' | 'leather' | 'rubber' | 'ceramic' | 'carbon';\nexport type Tone = 'solid' | 'split-h' | 'split-v' | 'split-diag' | 'chevron' | 'linear' | 'radial' | 'conic' | 'mesh';\nexport type Divider = 'sharp' | 'soft' | 'pinstripe';\nexport type Pattern = 'none' | 'stripes' | 'pinstripe' | 'chevron' | 'herringbone' | 'waves' | 'topo' | 'checker' | 'gingham' | 'grid' | 'hex' | 'dots' | 'halftone' | 'noise' | 'marble' | 'terrazzo' | 'camo' | 'circuit' | 'carbon' | 'damascus' | 'tiger' | 'zebra' | 'leopard' | 'kente' | 'zellige' | 'asanoha' | 'wood' | 'brick' | 'concrete' | 'plaster' | 'linen';\nexport type Profile = 'round' | 'chamfer';\nexport type Material = {\n    finish: Finish;\n    metal: number;\n    rough: number;\n    clearcoat: number;\n    coatRough: number;\n    sheen: number;\n    sheenRough: number;\n    irid: number;\n    iridThick: number;\n    aniso: number;\n    anisoRot: number;\n    flake: number;\n    flakeSize: number;\n    holo: number;\n    base: string;\n    baseAmount: number;\n    tone: Tone;\n    tone2: string;\n    split: number;\n    angle: number;\n    divider: Divider;\n    metal2: number;\n    rough2: number;\n    splitBind: string;\n    pattern: Pattern;\n    patScale: number;\n    patRot: number;\n    patContrast: number;\n    patSpace: 'card' | 'board';\n    patColour: number;\n    patRough: number;\n    patMetal: number;\n    patHeight: number;\n    patInk: string;\n    bevel: number;\n    profile: Profile;\n    inset: number;\n    rim: number;\n    stitch: boolean;\n    foilEdge: number;\n    notches: boolean;\n    torn: number;\n};\nexport declare const MATERIAL_DEFAULT: Material;\nexport type Env = 'studio' | 'warehouse' | 'sunset' | 'night' | 'overcast';\nexport type Light = {\n    angle: number;\n    height: number;\n    env: Env;\n    intensity: number;\n    tilt: number;\n    key: string;\n    fill: string;\n    fillAmount: number;\n    rim: string;\n    rimAmount: number;\n    soft: number;\n};\nexport declare const LIGHT_DEFAULT: Light;\nexport declare const FINISHES: Record<Finish, {\n    label: string;\n    set: Partial<Material>;\n    cost?: 'some' | 'high';\n}>;\nexport declare const TONES: readonly {\n    value: Tone;\n    label: string;\n}[];\nexport declare const PATTERNS: readonly {\n    value: Pattern;\n    label: string;\n}[];\ndeclare const FINISH_IDS: Finish[];\ndeclare const TONE_IDS: Tone[];\ndeclare const PATTERN_IDS: Pattern[];\ndeclare const DIVIDERS: readonly Divider[];\nexport declare const ENVS: readonly {\n    value: Env;\n    label: string;\n}[];\nexport declare const finishId: (f: Finish) => number;\nexport declare const toneId: (t: Tone) => number;\nexport declare const patternId: (p: Pattern) => number;\nexport declare const envId: (e: Env) => number;\nexport declare const MATERIAL_FLOATS = 48;\nexport declare function materialRows(m: Material, out: Float32Array<ArrayBufferLike>, at?: number): void;\nexport declare function materialAverage(m: Material, fill: string, split?: number): string;\nexport declare function contrast(a: string, b: string): number;\nexport declare function isBusy(m: Material, fill: string): boolean;\nexport declare const materialCost: (m: Material) => \"some\" | \"high\" | undefined;\nexport declare const MATERIAL_PRESETS: readonly {\n    name: string;\n    params: Record<string, string | number | boolean>;\n}[];\nexport declare function knobs(set: Partial<Material>): Record<string, string | number | boolean>;\nexport { DIVIDERS, FINISH_IDS, PATTERN_IDS, TONE_IDS };"
        },
        {
          "file": "light-rig.ts",
          "declarations": "import type { Env, Light } from './finishes';\nexport type V3 = [\n    number,\n    number,\n    number\n];\nexport type EnvParams = {\n    below: V3;\n    above: V3;\n    horizon: [\n        number,\n        number,\n        number,\n        number\n    ];\n    lightA: V3;\n    colourA: V3;\n    lightB: V3;\n    colourB: V3;\n    strips: [\n        number,\n        number,\n        number,\n        number\n    ];\n};\nexport declare function envParams(env: Env, key: {\n    x: number;\n    y: number;\n}): EnvParams;\nexport declare function keyDirection(light: Pick<Light, 'angle' | 'height'>): V3;\nexport declare function lightParams(light: Light): EnvParams;\nexport declare const keyPower: (light: Pick<Light, \"env\" | \"soft\">) => number;\nexport declare const fillDirection: (light: Pick<Light, \"angle\">) => V3;\nexport declare const rimDirection: (light: Pick<Light, \"angle\">) => V3;\nexport type Rig = {\n    key: {\n        dir: V3;\n        colour: V3;\n        intensity: number;\n    };\n    fill: {\n        dir: V3;\n        colour: V3;\n        intensity: number;\n    };\n    rim: {\n        dir: V3;\n        colour: V3;\n        intensity: number;\n    };\n    sky: {\n        colour: V3;\n        ground: V3;\n        intensity: number;\n    };\n    env: EnvParams;\n};\nexport declare function rigOf(light: Light): Rig;\nexport declare const toHatacDir: (v: V3) => V3;"
        }
      ],
      "pitfalls": [
        "surface() builds shader variables (toVar, addAssign)",
        "Shader compilers inline every call",
        "Keep the finish’s numbers in uniforms",
        "Flakes and brushing streaks fade by how many pixels they span (px)",
        "The diffuse is normalised to the key light’s height",
        "The light rig works in a board’s frame (x right, y down, z out of it)",
        "Highlights are soft-clipped toward 1 at the end of surface()"
      ],
      "card": "entries/card-material.json"
    },
    {
      "id": "card-springs",
      "aliases": [],
      "name": "Cards on springs",
      "summary": "Cards that feel like things: each sits on damped springs for its place, turn, squash, paper flutter and lift. It wobbles when the pointer comes onto it, squashes while pressed, leans and swings with the pointer’s speed as it is dragged, and when flung it flies to the stack it lands on, settles with an overshoot and jolts the card beneath. Only moving cards are stepped, so nothing runs at rest; nine named feels from bouncy to nearly still; every fling is a key too.",
      "category": "ui",
      "role": "interaction",
      "stack": [
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "springs",
        "physics",
        "fling",
        "drag",
        "cards",
        "stacks",
        "squash and stretch",
        "touch",
        "keyboard",
        "live region",
        "reduced motion",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "sorting and grouping boards",
        "card games and flash cards",
        "mood boards and photo piles",
        "playful dashboards whose tiles answer the hand",
        "giving any draggable tile a physical feel"
      ],
      "interaction": "Drag a swatch and fling it onto a pile · focus one and press ← → or 1–4 · Enter says where it is",
      "kits": [
        {
          "kit": "shop",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "drag-reorder",
          "why": "Reorder the springy cards by mouse, touch and keys"
        },
        {
          "id": "throw-to-commit",
          "why": "Throw a card at a tray to act on it"
        },
        {
          "id": "ui-sounds",
          "why": "A soft tap and lift sound under the hand"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "motion",
          "in": "module",
          "values": {
            "strict": "reduced",
            "refined": "auto",
            "playful": "full"
          }
        },
        {
          "name": "amount",
          "in": "module",
          "values": {
            "strict": 0,
            "refined": 0.6,
            "playful": 1.4
          },
          "note": "a feel’s strength: 0 holds still, 1 as made, up to 2"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.89,
            "p99Ms": 22.34,
            "low1Fps": 40.2
          },
          "notes": "Measured with the demo playing by itself: it deals the deck out to the three piles (nine flights, staggered), knocks the table, gathers them back and deals again. Each moving card writes its transform and --crs-lift once a frame; nothing runs while the cards rest."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 0.01,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 44 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.02,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 143 ms."
        }
      ],
      "signatures": [
        {
          "file": "card-springs.ts",
          "declarations": "import { type Feel } from './feel';\nimport type { Kick } from './springs';\nimport { type Point, type StackLook } from './stack';\nexport type MoveHow = 'drop' | 'throw' | 'key' | 'code';\nexport type CardSpringsOptions = {\n    piles: HTMLElement[];\n    card?: string;\n    feel?: Feel;\n    look?: StackLook;\n    motion?: 'auto' | 'full' | 'reduced';\n    lift?: number;\n    cardName?: (card: HTMLElement) => string;\n    pileName?: (pile: HTMLElement, index: number) => string;\n    announce?: (text: string) => void;\n    onMove?: (card: HTMLElement, from: number, to: number, how: MoveHow) => void;\n    onActive?: (active: boolean) => void;\n};\nexport type CardSprings = {\n    feel: Feel;\n    moveTo(card: HTMLElement, to: number, opts?: {\n        how?: MoveHow;\n        delay?: number;\n        from?: Point;\n        speed?: number;\n    }): void;\n    knock(k?: Kick): void;\n    refresh(): void;\n    settle(): void;\n    readonly active: boolean;\n    pileOf(card: HTMLElement): number;\n    dispose(): void;\n};\nexport declare function cardSprings(root: HTMLElement, options: CardSpringsOptions): CardSprings;"
        },
        {
          "file": "feel.ts",
          "declarations": "export type Feel = {\n    amount: number;\n    stiffness: number;\n    damping: number;\n    hover: number;\n    lift: number;\n    press: number;\n    lean: number;\n    swing: number;\n    stretch: number;\n    overshoot: number;\n    flutter: number;\n};\nexport declare const FEEL_DEFAULT: Feel;\nexport declare const FEELS: {\n    readonly bouncy: Feel;\n    readonly plush: Feel;\n    readonly crisp: Feel;\n    readonly heavy: Feel;\n    readonly paper: Feel;\n    readonly floaty: Feel;\n    readonly playful: Feel;\n    readonly jelly: Feel;\n    readonly still: Feel;\n};\nexport type FeelName = keyof typeof FEELS;"
        },
        {
          "file": "poses.ts",
          "declarations": "import { Springs } from './springs';\nexport type Pose = {\n    dx: number;\n    dy: number;\n    dz: number;\n    rot: number;\n    scale: number;\n    sx?: number;\n    sy?: number;\n    lift?: number;\n};\nexport declare const REST: Pose;\nexport type Motion = {\n    start: number;\n    duration: number;\n    at: (t: number) => Pose;\n};\nexport declare function glideLeft(t: number, k?: number): number;\nexport declare function glide(offset: {\n    x: number;\n    y: number;\n}, flutter: number): Motion['at'];\nexport declare function flight(offset: {\n    x: number;\n    y: number;\n}, flutter: number, lift: number): Motion['at'];\nexport declare function glideMs(offset: {\n    x: number;\n    y: number;\n}, speed: number, min?: number, max?: number): number;\nexport declare function compose(a: Pose, b: Pose): Pose;\nexport declare class Poses {\n    readonly springs: Springs;\n    play(id: string, motion: Motion): void;\n    has(id: string): boolean;\n    get active(): boolean;\n    get(id: string): Pose | undefined;\n    step(ms: number): string[];\n    settle(): string[];\n    stop(id: string): boolean;\n    forget(id: string): void;\n}"
        }
      ],
      "pitfalls": [
        "Give the card no background of its own",
        "The module owns the card’s transform (its place in the stack plus its pose)",
        "No z-index, transform, filter or overflow clip on a pile or on anything between the piles and…",
        "Only the top card of a stack takes the pointer and the keys",
        "The layout has the card in its new pile at once (DOM order, focus, labels, onMove)",
        "Pile boxes are measured at each move from root’s getBoundingClientRect",
        "The card sets touch-action",
        "Moving a focused card to another pile moves it in the DOM, which blurs it",
        "Strength 0 and reduced motion keep every move"
      ],
      "card": "entries/card-springs.json"
    },
    {
      "id": "cell-membranes",
      "aliases": [],
      "name": "Panels as living cells that divide",
      "summary": "A page’s panels drawn as living cells, in raw WebGPU (WebGL2 where it is missing): one smooth-unioned distance field round all of them, each edge wobbling, a bright membrane with a fainter inner leaflet, cytoplasm that is thin at the rim and calm under the text, drifting organelles and a nucleus. Change screens and every cell pinches in two, a neck forming and parting, and the halves migrate to the new screen’s panels; halves left over fuse into the nearest, and extra panels bud off. The plan and the timeline are pure functions of rects and a 0..1 progress, so a change can be scrubbed or interrupted midway. Hover and focus liven a cell; it rests when nothing moves, and fades instead under reduced motion.",
      "category": "ui",
      "role": "hero-visual",
      "stack": [
        "webgpu"
      ],
      "character": "expressive",
      "tags": [
        "cells",
        "membranes",
        "mitosis",
        "screen transition",
        "smooth minimum",
        "metaballs",
        "sdf",
        "dom + gpu",
        "raw webgpu",
        "wgsl",
        "glsl",
        "webgl2 fallback",
        "tabs",
        "timestamp queries",
        "rests when idle",
        "reduced motion",
        "no dependencies"
      ],
      "useCases": [
        "a screen or tab change that shows where each panel went",
        "an organic, biological theme for a dashboard or a science app",
        "panels that merge and split as a layout changes",
        "cards that liven on hover and focus without moving",
        "teaching cell division"
      ],
      "interaction": "Pick a screen (or arrow along the tabs) and watch every panel divide · hover a cell",
      "kits": [],
      "pairsWith": [
        {
          "id": "panel-choreography",
          "why": "Panels that arrive before the cells divide round them"
        },
        {
          "id": "effects-switchboard",
          "why": "Let people turn the living backdrop off"
        },
        {
          "id": "capability-tiers",
          "why": "A still page where the GPU is weak"
        }
      ],
      "variants": [],
      "version": "1.1.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [
        {
          "name": "wobble",
          "in": "module",
          "values": {
            "strict": 0.8,
            "refined": 1.6,
            "playful": 3.2
          },
          "note": "px the edge wobbles (default 2.4)"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-13",
          "gpuMs": 0.199,
          "cpuMs": 0.165,
          "cpuP95Ms": 0.345,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "The three screens in turn, a screen change every 1.6 s (each cell pinching in two, the halves migrating, the leftovers fusing), membranes wobbling and a cell hovered; one full-screen pass over up to 12 cells, timed with its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.262,
          "cpuMs": 0.243,
          "cpuP95Ms": 0.48,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.665,
            "p99Ms": 18,
            "low1Fps": 51.9
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 127 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 6.717,
          "cpuMs": 0.18,
          "cpuP95Ms": 0.66,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 194 ms."
        }
      ],
      "signatures": [
        {
          "file": "membranes.ts",
          "declarations": "export type Cell = {\n    x: number;\n    y: number;\n    width: number;\n    height: number;\n    radius?: number;\n    hover?: number;\n    wobble?: number;\n    fill?: number;\n};\nexport type MembraneColours = {\n    membrane: string;\n    second: string;\n    cytoplasm: string;\n    light: boolean;\n};\nexport type MembraneFrame = {\n    time: number;\n    union?: number;\n    wobble?: number;\n    organelles?: number;\n    nucleus?: number;\n    halo?: number;\n};\nexport type Membranes = {\n    readonly api: 'webgpu' | 'webgl2';\n    device: GPUDevice | null;\n    resize(width: number, height: number, dpr: number): void;\n    setCells(cells: readonly Cell[]): void;\n    theme(colours: MembraneColours): void;\n    frame(f: MembraneFrame): boolean;\n    gpuMs(): number | null;\n    readonly lost: boolean;\n    onLost: ((reason: string) => void) | null;\n    dispose(): void;\n};\nexport declare const MAX_CELLS = 32;\nexport declare function hexRgb(hex: string): [\n    number,\n    number,\n    number\n];\nexport declare function packCells(cells: readonly Cell[], out: Float32Array): number;\nexport declare function createMembranes(canvas: HTMLCanvasElement, { device: given, onError, webgl }?: {\n    device?: GPUDevice;\n    onError?: (message: string) => void;\n    webgl?: boolean;\n}): Promise<Membranes | null>;\nexport declare function createMembranesGL(canvas: HTMLCanvasElement, { onError }?: {\n    onError?: (message: string) => void;\n}): Promise<Membranes | null>;"
        },
        {
          "file": "mitosis.ts",
          "declarations": "export type Rect = {\n    x: number;\n    y: number;\n    width: number;\n    height: number;\n};\nexport type Piece = {\n    from: Rect;\n    half: Rect;\n    to: Rect;\n    fuses: boolean;\n};\nexport type MitosisPlan = {\n    pieces: Piece[];\n    union: number;\n};\nexport type MitosisOptions = {\n    gap?: number;\n    union?: number;\n    minSize?: number;\n    split?: boolean;\n};\nexport declare function splitRect(r: Rect, gap?: number): [\n    Rect,\n    Rect\n];\nexport declare function planMitosis(from: readonly Rect[], to: readonly Rect[], { gap, union, minSize, split }?: MitosisOptions): MitosisPlan & {\n    unreached: number[];\n};\nexport declare const PINCH: number;\nexport declare const MITOSIS_MS = 1100;\nexport declare const easeInOut: (k: number) => number;\nexport declare const lerpRect: (a: Rect, b: Rect, k: number) => Rect;\nexport declare function mitosisAt(plan: MitosisPlan, t: number): {\n    rects: Rect[];\n    union: number;\n    phase: 'pinch' | 'migrate' | 'done';\n};"
        }
      ],
      "pitfalls": [
        "Measure the new screen before it shows",
        "A change during a change must start from where the halves are, not from the old screen’s panels",
        "The union radius must be smaller than the gap the halves pull apart (20 against 30 px)",
        "The field is a loop over every cell per pixel",
        "Text sits on the cytoplasm, which is thin near the membrane",
        "The canvas is premultiplied, and an additive glow can exceed its alpha",
        "Under reduced motion swap the division for a short fade and hold the membranes still",
        "Without WebGPU the membranes draw with WebGL2 from membranes-glsl.ts",
        "The WebGPU device can be lost (a driver reset, a sleeping laptop)",
        "splitRect keeps the source’s shape",
        "Hide the old screen’s content at once when the change starts"
      ],
      "card": "entries/cell-membranes.json"
    },
    {
      "id": "chart-access",
      "aliases": [
        "colour-vision"
      ],
      "name": "Colour-blind safe charts and palettes",
      "summary": "Charts and palettes that colour-blind readers, screen readers and keyboards can use. Colour-blindness simulation (Machado 2009, protanopia, deuteranopia, tritanopia and no colour at all, at any severity) with CIEDE2000 checks that every pair of a palette stays apart for every vision, and a repair that moves a palette that fails as little as it can in OKLCH, lightness first, until every pair clears. A lens you drag across any live screen shows one side as a colour-blind reader sees it while the view stays usable underneath, and a reader lists the colours a view really draws with. For the chart itself: any chart as a plain table copyable as CSV or TSV, two sides (scenarios, years, before and after) compared as tables with every change in words and a sign, and keyboard travel along a graph with words for screen readers. Pure TypeScript but the lens (an SVG filter, drawn split in Chromium); pairs with any chart.",
      "category": "data",
      "role": "foundation",
      "stack": [
        "headless",
        "dom"
      ],
      "character": "calm",
      "tags": [
        "accessibility",
        "colour blindness",
        "colour vision deficiency",
        "simulation",
        "CIEDE2000",
        "OKLCH",
        "palette",
        "design tokens",
        "backdrop-filter",
        "SVG filter",
        "split view",
        "screen readers",
        "keyboard",
        "tables",
        "CSV",
        "compare",
        "scenarios",
        "WCAG 1.4.1",
        "no dependencies"
      ],
      "useCases": [
        "chart and dashboard palettes",
        "status colours",
        "design-system colour checks in tests, with suggested fixes",
        "repairing status and chart colours with the least change",
        "reviewing a screen for colour blindness while you build it",
        "auditing the colours a page actually draws with",
        "showing a team what a colour-blind user sees",
        "\"show as table\" for any chart",
        "copy to a spreadsheet",
        "two scenarios or periods compared, for screen readers",
        "keyboard-navigable charts and diagrams"
      ],
      "interaction": "Charts: edit the palette · hover a warning · click the chart and use the arrow keys · Lens & repair: drag the split · Suggest a fix, then Apply",
      "kits": [
        {
          "kit": "dashboard",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "quiet-charts",
          "why": "Tables and words for every quiet chart"
        },
        {
          "id": "more-chart-types",
          "why": "The same for treemaps, box plots and radars"
        },
        {
          "id": "appearance-theme",
          "why": "Check every theme preset through the lens"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "mixed",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-17",
          "gpuMs": null,
          "cpuMs": 0.285,
          "cpuP95Ms": 0.725,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.91,
            "p99Ms": 18.235,
            "low1Fps": 52.2
          },
          "notes": "Measured with the palette check (every pair of six colours under four visions, CIEDE2000) and the four simulated charts recomputed every frame. Live they run only when a colour or a control changes, so an idle chart costs nothing. Measured on the charts part, which opens first; the lens part (Part: Lens) runs only while it is shown."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.425,
          "cpuP95Ms": 0.575,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 135 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.4,
          "cpuP95Ms": 0.44,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 74 ms."
        }
      ],
      "signatures": [
        {
          "file": "colorblind.ts",
          "declarations": "export type Vision = 'normal' | 'protan' | 'deutan' | 'tritan' | 'achroma';\nexport declare const VISIONS: readonly Vision[];\nexport declare const ALL_VISIONS: readonly Vision[];\nexport type Rgb = [\n    number,\n    number,\n    number\n];\ntype M3 = readonly [\n    readonly [\n        number,\n        number,\n        number\n    ],\n    readonly [\n        number,\n        number,\n        number\n    ],\n    readonly [\n        number,\n        number,\n        number\n    ]\n];\nexport declare function hexToRgb(hex: string): Rgb;\nexport declare function toHex(rgb: readonly [\n    number,\n    number,\n    number\n]): string;\nexport declare function visionMatrix(vision: Vision, severity?: number): M3;\nexport declare function simulate(hex: string, vision: Vision, severity?: number): Rgb;\nexport declare function simulateRgb(rgb: Rgb, vision: Vision, severity?: number): Rgb;\nexport declare function svgMatrix(vision: Vision, severity?: number): string;\nexport declare function lab(rgb: readonly [\n    number,\n    number,\n    number\n]): [\n    number,\n    number,\n    number\n];\nexport declare function deltaE00(lab1: readonly [\n    number,\n    number,\n    number\n], lab2: readonly [\n    number,\n    number,\n    number\n]): number;\nexport declare function deltaE(c1: readonly [\n    number,\n    number,\n    number\n], c2: readonly [\n    number,\n    number,\n    number\n]): number;\nexport declare function closest(a: string, b: string, visions?: readonly Vision[], severity?: number): {\n    vision: Vision;\n    dE: number;\n};\nexport declare const DISTINCT = 20;\nexport type PairCheck = {\n    a: number;\n    b: number;\n    vision: Vision;\n    dE: number;\n    normal: number;\n};\nexport declare function paletteCheck(colours: readonly string[], min?: number, visions?: readonly Vision[], severity?: number): PairCheck[];\nexport declare function firstApart(against: readonly string[], candidates: readonly string[], min?: number, visions?: readonly Vision[], severity?: number): string;\nexport {};"
        },
        {
          "file": "compare.ts",
          "declarations": "import { type PlainTable } from './tables';\nexport type Direction = 'up' | 'down' | 'same' | 'new' | 'gone';\nexport declare const DIRECTION_SIGN: Record<Direction, string>;\nexport declare const DIRECTION_SAYS: Record<Direction, string>;\nexport type Change = {\n    dir: Direction;\n    short: string;\n    long: string;\n    a: string;\n    b: string;\n};\nexport type Figure = {\n    name: string;\n    where?: string;\n    value: number | string | null;\n    percent?: boolean;\n};\nexport type Side = {\n    inputs?: readonly Figure[];\n    results: readonly Figure[];\n};\nexport declare function changeBetween(a: Figure['value'] | undefined, b: Figure['value'] | undefined, num: (n: number) => string, percent?: boolean): Change;\nexport declare const changeWords: (c: Change) => string;\nexport declare function compareAsTables(a: Side, b: Side, names: readonly [\n    string,\n    string\n], num: (n: number) => string): PlainTable[];"
        },
        {
          "file": "inuse.ts",
          "declarations": "export type ColourRole = 'text' | 'background' | 'border' | 'fill' | 'stroke';\nexport type ColourUse = {\n    hex: string;\n    count: number;\n    roles: Partial<Record<ColourRole, number>>;\n    elements: Element[];\n};\nexport type InUseOptions = {\n    minChroma?: number;\n    minAlpha?: number;\n    roles?: readonly ColourRole[];\n};\nexport declare function colourReader(doc?: Document): (css: string) => {\n    hex: string;\n    alpha: number;\n} | null;\nexport declare function coloursInUse(root: Element, o?: InUseOptions): ColourUse[];"
        },
        {
          "file": "lens.ts",
          "declarations": "import { type Vision } from './colorblind';\nexport type LensMode = 'split' | 'whole' | 'off';\nexport type LensOptions = {\n    vision?: Vision;\n    severity?: number;\n    mode?: LensMode;\n    at?: number;\n    names?: Partial<Record<Vision, string>>;\n    onMove?: (at: number) => void;\n};\nexport type Lens = {\n    set(o: Partial<Omit<LensOptions, 'onMove' | 'names'>>): void;\n    readonly mode: LensMode;\n    readonly at: number;\n    dispose(): void;\n};\nexport declare const VISION_NAMES: Record<Vision, string>;\nexport declare function splitSupported(): boolean;\nexport declare function createLens(view: HTMLElement, options?: LensOptions): Lens;"
        },
        {
          "file": "repair.ts",
          "declarations": "import { type PairCheck, type Vision } from './colorblind';\nexport type RepairOptions = {\n    min?: number;\n    visions?: readonly Vision[];\n    severity?: number;\n    keep?: readonly number[];\n    maxShift?: number;\n};\nexport type Change = {\n    index: number;\n    from: string;\n    to: string;\n    shift: number;\n};\nexport type Repair = {\n    colours: string[];\n    changes: Change[];\n    before: PairCheck[];\n    left: PairCheck[];\n};\nexport declare function repairPalette(colours: readonly string[], o?: RepairOptions): Repair;"
        },
        {
          "file": "tables.ts",
          "declarations": "export type PlainTable = {\n    title: string;\n    caption?: string;\n    columns: string[];\n    rows: string[][];\n    numeric: boolean[];\n};\nexport type ChartTable = {\n    title: string;\n    categories: string[];\n    series: {\n        name: string;\n        values: number[];\n    }[];\n    filtered?: string;\n    grid?: {\n        head: string[];\n        numeric: boolean[];\n        rows: {\n            cells: {\n                text: string;\n            }[];\n        }[];\n        total: {\n            text: string;\n        }[] | null;\n    };\n    flow?: {\n        nodes: {\n            label: string;\n        }[];\n        links: {\n            from: number;\n            to: number;\n            amount: number;\n        }[];\n    };\n    tasks?: {\n        label: string;\n        start: number;\n        end: number;\n    }[];\n    spreads?: {\n        name: string;\n        p10: number;\n        p50: number;\n        p90: number;\n        mean: number;\n        min: number;\n        max: number;\n    }[];\n    xy?: {\n        xName: string;\n        yName: string;\n        sName?: string;\n        points: {\n            label: string;\n            x: number;\n            y: number;\n            s: number;\n        }[];\n    };\n    ranges?: ({\n        p10: number;\n        p90: number;\n    } | null)[][];\n    rangeRuns?: number;\n};\nexport type OutlineNode = {\n    text: string;\n    children: OutlineNode[];\n};\nexport declare function table(title: string, columns: string[], rows: string[][], caption?: string): PlainTable;\nexport declare function chartAsTable(t: ChartTable, num: (n: number) => string, title?: string): PlainTable;\nexport declare function outlineAsTable(outline: readonly OutlineNode[], title?: string, layout?: string): PlainTable;\nexport declare function toTsv(t: PlainTable): string;\nexport declare function toCsv(t: PlainTable): string;"
        },
        {
          "file": "travel.ts",
          "declarations": "export type Edge = {\n    from: string;\n    to: string;\n    via: string;\n};\nexport type FlowGraph = {\n    nodes: string[];\n    outs: Map<string, Edge[]>;\n    ins: Map<string, Edge[]>;\n};\nexport type Move = 'next' | 'prev' | 'down' | 'up' | 'right' | 'left';\nexport declare function flowGraph(items: readonly {\n    id: string;\n    kind: string;\n    from?: string | null;\n    to?: string | null;\n}[], rank?: (id: string) => number): FlowGraph;\nexport declare function travel(g: FlowGraph, at: string | null, move: Move, came?: string | null): {\n    to: string;\n    came: string | null;\n} | null;\nexport declare function stationWords(o: {\n    name: string;\n    index: number;\n    count: number;\n    values: readonly string[];\n    load: number | null;\n    from: readonly string[];\n    to: readonly string[];\n    came?: string | null;\n}): string;"
        }
      ],
      "pitfalls": [
        "Compare sides by name (and where)",
        "A palette that passes the check still needs a second channel",
        "Check every pair, not neighbours",
        "Status colours need 20 (apart at a glance)",
        "Achromatopsia leaves only lightness, so six colours rarely all pass it",
        "Simulate in linear RGB, as here",
        "Simulation is a model, and severity below 100% blends toward the full-severity matrix",
        "The repair moves colours you named as a group (status, chart lines, tags)",
        "A repaired fill can lose contrast with text drawn on it",
        "The lens’s split is a veil with backdrop-filter",
        "A filter or opacity on an ancestor of the lens’s veil becomes its backdrop root",
        "coloursInUse reads computed styles of every visible element",
        "Copy numbers to the table as the chart writes them (num), not raw floats",
        "role=\"application\" on the chart lets the arrow keys reach it under a screen reader"
      ],
      "card": "entries/chart-access.json"
    },
    {
      "id": "cinematic-lens",
      "aliases": [],
      "name": "Cinematic lens",
      "summary": "A post chain for any HDR picture on WebGPU (and a WebGL2 twin of it): bloom from a 13-tap halving chain, light shafts streamed from a point or from the brightest spot (found on the GPU) that panels or objects over the scene can block, a colour grade with a soft shoulder and lift/gamma/gain, vignette, colour fringe and film grain. Every stage optional, every knob a plain number.",
      "category": "post",
      "role": "hero-visual",
      "stack": [
        "webgpu"
      ],
      "character": "balanced",
      "tags": [
        "bloom",
        "webgl2 fallback",
        "god rays",
        "light shafts",
        "colour grading",
        "tone mapping",
        "film grain",
        "vignette",
        "wgsl",
        "raw webgpu",
        "hdr",
        "occlusion mask",
        "ui over 3d"
      ],
      "useCases": [
        "splash and title screens",
        "games and 3D scenes",
        "product showcases",
        "music visualisers",
        "photo and video looks",
        "any WebGPU renderer that draws to HDR",
        "glass panels over a 3D scene that cast shadows into its light"
      ],
      "interaction": "Drag the line to compare · drag a panel through the shafts · click the scene to light a flare",
      "kits": [
        {
          "kit": "product-presentation",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "physical-sky",
          "why": "Light shafts streamed from its sun"
        },
        {
          "id": "arrival-shockwave",
          "why": "Grade and bloom on the title moment"
        },
        {
          "id": "dynamic-resolution",
          "why": "Keeps the frame budget with the post chain on"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 4.81,
          "cpuMs": 0.145,
          "cpuP95Ms": 0.225,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured on the Filmic look with the scene moving and every stage on, the split off: the demo’s scene pass, then the lens (bright parts, five halvings and four doublings, the brightest-spot search, 48-sample shafts at half size, the composite), timed with their own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.049,
          "cpuMs": 0.27,
          "cpuP95Ms": 0.445,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 331 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 9.546,
          "cpuMs": 0.34,
          "cpuP95Ms": 0.48,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 1097 ms."
        }
      ],
      "signatures": [
        {
          "file": "cinematic-lens-gl.ts",
          "declarations": "import { type LensPatch, type LensSettings } from './cinematic-lens';\nexport type CinematicLensGL = {\n    readonly settings: Readonly<LensSettings>;\n    set(patch: LensPatch): void;\n    resize(width: number, height: number): void;\n    render(input: WebGLTexture, target: WebGLFramebuffer | null, options?: {\n        seed?: number;\n        occluder?: WebGLTexture | null;\n    }): void;\n    dispose(): void;\n};\nexport declare function enableHdr(gl: WebGL2RenderingContext): boolean;\nexport declare function createCinematicLensGL(gl: WebGL2RenderingContext, { width, height, settings }: {\n    width: number;\n    height: number;\n    settings?: LensPatch;\n}): CinematicLensGL | null;"
        },
        {
          "file": "cinematic-lens.ts",
          "declarations": "export type RGB = [\n    number,\n    number,\n    number\n];\nexport type ShaftOccluder = {\n    x: number;\n    y: number;\n    width: number;\n    height: number;\n    radius?: number;\n    softness?: number;\n    opacity?: number;\n};\nexport type LensSettings = {\n    bloom: {\n        enabled: boolean;\n        threshold: number;\n        strength: number;\n        radius: number;\n        levels: number;\n    };\n    shafts: {\n        enabled: boolean;\n        strength: number;\n        decay: number;\n        length: number;\n        samples: number;\n        centre: 'auto' | {\n            x: number;\n            y: number;\n        };\n        tint: RGB;\n        occluders: ShaftOccluder[];\n        mask: number;\n    };\n    grade: {\n        enabled: boolean;\n        exposure: number;\n        contrast: number;\n        saturation: number;\n        temperature: number;\n        tint: number;\n        lift: RGB;\n        gamma: RGB;\n        gain: RGB;\n        tone: 'shoulder' | 'clamp';\n    };\n    vignette: {\n        amount: number;\n    };\n    grain: {\n        amount: number;\n        size: number;\n    };\n    fringe: {\n        amount: number;\n    };\n    split: number | null;\n};\nexport type LensPatch = {\n    [K in Exclude<keyof LensSettings, 'split'>]?: Partial<LensSettings[K]>;\n} & {\n    split?: number | null;\n};\nexport declare const DEFAULT_LENS: LensSettings;\nexport declare const HDR_FORMAT: GPUTextureFormat;\nexport type RenderOptions = {\n    seed?: number;\n    occluder?: GPUTexture;\n    timestampWrites?: {\n        querySet: GPUQuerySet;\n        beginningOfPassWriteIndex: number;\n        endOfPassWriteIndex: number;\n    };\n};\nexport type CinematicLens = {\n    readonly settings: Readonly<LensSettings>;\n    set(patch: LensPatch): void;\n    resize(width: number, height: number): void;\n    render(encoder: GPUCommandEncoder, input: GPUTexture, target: GPUTextureView, options?: RenderOptions): void;\n    dispose(): void;\n};\nexport declare function whiteBalance(temperature: number, tint: number): RGB;\nexport declare function createCinematicLens(device: GPUDevice, { format, width, height, settings }: {\n    format: GPUTextureFormat;\n    width: number;\n    height: number;\n    settings?: LensPatch;\n}): Promise<CinematicLens>;"
        }
      ],
      "pitfalls": [
        "Without WebGPU use the WebGL2 twin (createCinematicLensGL)",
        "The input is display-referred",
        "Write to a plain canvas format (getPreferredCanvasFormat()), not an -srgb one",
        "The input must be rgba16float with TEXTURE_BINDING usage",
        "The auto centre needs at least four halvings and finds the brightest blob, not the biggest",
        "Shafts stream the same bright parts that bloom",
        "Moving grain needs a new seed each frame",
        "Settings are read at render()",
        "Occluders take light out of the shafts, not out of the bloom or the picture",
        "An occluder mask is sampled with filtering",
        "Blocking costs one more pass at half size"
      ],
      "card": "entries/cinematic-lens.json"
    },
    {
      "id": "circuit-from-text",
      "aliases": [],
      "name": "Circuit board from text",
      "summary": "Any word becomes a real-looking circuit board: its letters thinned to their centrelines and strung with LEDs, each letter fed from its own driver on a bus from a microcontroller, with the socket, regulator, crystal, decoupling, vias, pour and silkscreen a designer would add. Then the power comes on: a front of light runs along the copper from the socket, waking the chips and lighting each LED as it reaches it. Raw WebGPU draws every layer per pixel, the parts as instanced boxes, with bloom.",
      "category": "surface",
      "role": "hero-visual",
      "stack": [
        "webgpu"
      ],
      "character": "expressive",
      "tags": [
        "circuit board",
        "pcb",
        "text effect",
        "skeleton",
        "thinning",
        "procedural",
        "leds",
        "glow",
        "wgsl",
        "raw webgpu",
        "instancing",
        "bloom",
        "deterministic"
      ],
      "useCases": [
        "title cards and splash screens",
        "a stage moment that powers up a name",
        "hardware, maker and engineering pages",
        "loading moments with a progress to show",
        "hero sections and event intros"
      ],
      "interaction": "Drag or use the arrow keys to turn the board · Enter to power it up again",
      "kits": [],
      "pairsWith": [
        {
          "id": "fibre-light",
          "why": "The same word written in light"
        },
        {
          "id": "glass-engraving",
          "why": "The same word engraved in glass"
        },
        {
          "id": "laser-cutting",
          "why": "The same word cut from steel"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 5.711,
          "cpuMs": 0.15,
          "cpuP95Ms": 0.23,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "The word \"Hello\" (about 70 parts, 40 LEDs) powering up over 9 s, framed on the word, medium quality (1080p, 4× MSAA), the camera drifting, then held lit for a second and run again: the board quad, its edges, the instanced parts, a five-level bloom and the tone map; timed with its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.704,
          "cpuMs": 0.295,
          "cpuP95Ms": 0.52,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 331 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 6.893,
          "cpuMs": 0.4,
          "cpuP95Ms": 0.5,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 715 ms."
        }
      ],
      "signatures": [
        {
          "file": "board.ts",
          "declarations": "import { type Stroke } from './font';\nexport type V2 = [\n    number,\n    number\n];\nexport type BoardMask = {\n    data: Uint8Array;\n    w: number;\n    h: number;\n    cap: number;\n};\nexport declare function inkBox(mask: Pick<BoardMask, 'data' | 'w' | 'h'>): {\n    x0: number;\n    y0: number;\n    x1: number;\n    y1: number;\n} | null;\nexport declare function seeded(seed: number): () => number;\nexport type Part = {\n    kind: number;\n    x: number;\n    y: number;\n    rot: number;\n    ref: string;\n    letter: number;\n    d: number;\n    code: number;\n};\nexport type BoardPad = {\n    x: number;\n    y: number;\n    hx: number;\n    hy: number;\n    r: number;\n    a: number;\n    d: number;\n    paste: boolean;\n    part: number;\n    round: boolean;\n};\nexport type Trace = {\n    pts: V2[];\n    w: number;\n    ds: number[];\n    letter: number;\n};\nexport type Via = {\n    x: number;\n    y: number;\n    ring: number;\n    drill: number;\n    d: number;\n    letter: number;\n};\nexport type Letter = {\n    box: [\n        number,\n        number,\n        number,\n        number\n    ];\n    start: V2;\n    d0: number;\n    d1: number;\n    leds: number[];\n};\nexport type Board = {\n    x0: number;\n    y0: number;\n    x1: number;\n    y1: number;\n    corner: number;\n    parts: Part[];\n    pads: BoardPad[];\n    traces: Trace[];\n    vias: Via[];\n    silk: Stroke[];\n    silkW: number;\n    holes: [\n        number,\n        number,\n        number,\n        number\n    ][];\n    fiducials: V2[];\n    letters: Letter[];\n    name: {\n        x0: number;\n        y0: number;\n        x1: number;\n        y1: number;\n        cap: number;\n    };\n    mcu: number;\n    dMax: number;\n};\nexport type BoardSpec = {\n    size: number;\n    pitch: number;\n    density: number;\n    seed: number;\n    title?: string;\n};\nexport declare function pointAt(pts: V2[], s: number): {\n    p: V2;\n    t: V2;\n};\nexport declare function designBoard(word: BoardMask, spec: BoardSpec): Board;\nexport declare function segDist(x: number, y: number, a: V2, b: V2): number;"
        },
        {
          "file": "circuit.ts",
          "declarations": "import type { Board } from './board';\nimport { type V3, type ViewInput } from './view';\nexport type Quality = 'low' | 'medium' | 'high';\nexport declare const QUALITY: Record<Quality, {\n    pixels: number;\n    msaa: number;\n}>;\nexport type MaskColour = 'green' | 'black' | 'blue' | 'red';\nexport declare const MASKS: Record<MaskColour, readonly [\n    V3,\n    V3,\n    number\n]>;\nexport type CircuitColours = {\n    led: string;\n    current: string;\n    light: string;\n    background: string;\n};\nexport type CircuitView = ViewInput & {\n    frame?: 'board' | 'word';\n    power: number;\n    light?: number;\n    glow?: number;\n    leds?: number;\n    exposure?: number;\n    vignette?: number;\n    flow?: number;\n};\nexport type CircuitOptions = {\n    device?: GPUDevice;\n    quality?: Quality;\n    mask?: MaskColour;\n    colours?: Partial<CircuitColours>;\n};\nexport type CircuitBoard = {\n    readonly device: GPUDevice;\n    setBoard(board: Board): void;\n    setQuality(quality: Quality): void;\n    setMask(mask: MaskColour): void;\n    setColours(colours: Partial<CircuitColours>): void;\n    draw(view: CircuitView): boolean;\n    ready(): Promise<void>;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare function wordBox(b: Pick<Board, 'name' | 'x0' | 'y0' | 'x1' | 'y1'>): {\n    x0: number;\n    y0: number;\n    x1: number;\n    y1: number;\n    top: number;\n};\nexport declare function createCircuitBoard(canvas: HTMLCanvasElement, options?: CircuitOptions): Promise<CircuitBoard | null>;"
        },
        {
          "file": "mask.ts",
          "declarations": "import type { BoardMask } from './board';\nexport type TextMaskOptions = {\n    px?: number;\n    family?: string;\n    weight?: number | string;\n    spacing?: number;\n    doc?: Document;\n};\nexport declare function textMask(text: string, { px, family, weight, spacing, doc }?: TextMaskOptions): BoardMask;"
        },
        {
          "file": "pack.ts",
          "declarations": "import type { Board } from './board';\nexport declare const CELL = 0.8;\nexport declare const LIGHT_CELL = 2;\nexport declare const PRIM: {\n    readonly trace: 0;\n    readonly pad: 1;\n    readonly via: 2;\n    readonly silk: 3;\n    readonly hole: 4;\n    readonly fiducial: 5;\n    readonly body: 6;\n};\nexport declare const PRIM_VEC = 3;\nexport declare const INST_VEC = 3;\nexport type BoardData = {\n    prims: Float32Array<ArrayBuffer>;\n    cells: Uint32Array<ArrayBuffer>;\n    index: Uint32Array<ArrayBuffer>;\n    grid: {\n        x0: number;\n        y0: number;\n        cols: number;\n        rows: number;\n        lcols: number;\n        lrows: number;\n        lightCells: number;\n    };\n    leds: Float32Array<ArrayBuffer>;\n    inst: Float32Array<ArrayBuffer>;\n    boxes: number;\n    cans: number;\n};\nexport declare function boardData(b: Board): BoardData;\nexport declare function powerAt(b: Pick<Board, 'dMax'>, power: number): {\n    front: number;\n    all: number;\n};\nexport declare function litCount(b: Pick<Board, 'dMax' | 'parts'>, power: number): {\n    lit: number;\n    total: number;\n};"
        },
        {
          "file": "still.ts",
          "declarations": "import type { Board } from './board';\nexport type StillOptions = {\n    power?: number;\n    mask?: 'green' | 'black' | 'blue' | 'red';\n    led?: string;\n    current?: string;\n    background?: string;\n    fill?: number;\n};\nexport declare function drawCircuitStill(g: CanvasRenderingContext2D, b: Board, options?: StillOptions): void;"
        }
      ],
      "pitfalls": [
        "Designing a board is CPU work (thinning, tracing and placing: about 20–80 ms for a word)",
        "The mask must be big enough",
        "Thin or script fonts make wandering centrelines",
        "A long word makes a long board",
        "Draw at the canvas’s own width and height",
        "`draw` returns false when the last frame is still on the GPU",
        "Without WebGPU createCircuitBoard returns null"
      ],
      "card": "entries/circuit-from-text.json"
    },
    {
      "id": "clay-sheet",
      "aliases": [],
      "name": "A clay sheet you press, pinch and smooth",
      "summary": "A slab of clay on a linen board that keeps every touch. Press a fingertip in and the clay rises in a rim round it; pinch a nub up, or squeeze a ridge between two fingers; rub it smooth; drag it into a smear that piles up ahead. The clay is a height field on the CPU where every tool only moves clay, never makes or loses any, and anything steeper than the clay can hold slumps until it stands. A raw WebGPU pass draws it from the rows an edit touched (sent as half floats): bicubic heights for smooth normals, a soft shadow marched toward a low light, cavities, grog, a damp sheen and warm light in the hollows. Mouse, two-finger touch and the keyboard, one undo step a stroke; a Canvas 2D view where WebGPU is missing; nothing draws while nothing moves.",
      "category": "surface",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "clay",
        "sculpt",
        "height field",
        "deform",
        "press",
        "pinch",
        "smooth",
        "smear",
        "mass conserving",
        "angle of repose",
        "touch",
        "multi-touch",
        "keyboard",
        "undo",
        "bicubic",
        "soft shadows",
        "half float",
        "raw webgpu",
        "wgsl",
        "canvas 2d fallback",
        "draw on demand",
        "timestamp queries",
        "no dependencies"
      ],
      "useCases": [
        "a tactile toy or a calm, hands-on moment in an app",
        "a sculpting or stamping surface: seals, dimples, signatures pressed in",
        "a material for a game: a dough, a putty, a wax or a sand tray",
        "teaching volume that is kept: whatever you push down rises somewhere else",
        "a soft height field to build terrain brushes on"
      ],
      "interaction": "Press, pinch, smooth or drag the clay · two fingers squeeze a ridge · on the sheet: arrows, hold Space, 1–4, [ ], Ctrl+Z",
      "kits": [],
      "pairsWith": [
        {
          "id": "material-designer",
          "why": "Finishes for the clay and the board"
        },
        {
          "id": "ui-sounds",
          "why": "Soft sounds as the clay gives"
        },
        {
          "id": "labelled-undo",
          "why": "Take back a press or a smear by name"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-13",
          "gpuMs": 1.676,
          "cpuMs": 0.345,
          "cpuP95Ms": 0.75,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured while a pressing finger travels round the slab and drags clay behind it (dirty rows uploaded as half floats, one full-canvas pass with a 14-step shadow march), timed by its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.573,
          "cpuMs": 0.5,
          "cpuP95Ms": 0.77,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 215 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 9.6,
          "cpuMs": 0.5,
          "cpuP95Ms": 0.58,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 327 ms."
        }
      ],
      "signatures": [
        {
          "file": "clay-tools.ts",
          "declarations": "import { type ClaySheet, type Rect } from './clay';\nexport type ClayTool = 'press' | 'pinch' | 'smooth' | 'drag';\nexport declare const TOOLS: ClayTool[];\nexport type ClayToolsOptions = {\n    toGrid(clientX: number, clientY: number): [\n        number,\n        number\n    ] | null;\n    onEdit(rect: Rect | null): void;\n    onState?(state: ClayToolsState): void;\n};\nexport type ClayToolsState = {\n    tool: ClayTool;\n    radius: number;\n    strength: number;\n    cursor: [\n        number,\n        number\n    ];\n    keyboard: boolean;\n    active: boolean;\n    canUndo: boolean;\n    canRedo: boolean;\n};\nexport type ClayTools = {\n    tool: ClayTool;\n    radius: number;\n    strength: number;\n    step(dt: number): Rect | null;\n    readonly busy: boolean;\n    undo(): void;\n    redo(): void;\n    reset(): void;\n    checkpoint(): void;\n    readonly state: ClayToolsState;\n    dispose(): void;\n};\nexport declare function createClayTools(el: HTMLElement, sheet: ClaySheet, opts: ClayToolsOptions): ClayTools;"
        },
        {
          "file": "clay-view.ts",
          "declarations": "import type { ClaySheet, Rect } from './clay';\nexport type ClayLook = {\n    clay: string;\n    board: string;\n    wet: number;\n    grain: number;\n    relief: number;\n    light: number;\n};\nexport type ClayView = {\n    readonly mode: 'webgpu' | 'canvas2d';\n    look: ClayLook;\n    place(x: number, y: number, width: number, height: number): void;\n    upload(rect: Rect | null): void;\n    draw(): boolean;\n    pixelRatio: number;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare const DEFAULT_LOOK: ClayLook;\nexport declare function toHalf(v: number): number;\nexport declare function createClayView(canvas: HTMLCanvasElement, sheet: ClaySheet, { webgpu, look }?: {\n    webgpu?: boolean | undefined;\n    look?: ClayLook | undefined;\n}): Promise<ClayView>;"
        },
        {
          "file": "clay.ts",
          "declarations": "export type Rect = {\n    x0: number;\n    y0: number;\n    x1: number;\n    y1: number;\n};\nexport type ClayOptions = {\n    thickness?: number;\n    margin?: number;\n    corner?: number;\n    repose?: number;\n};\nexport type ClaySheet = {\n    readonly width: number;\n    readonly height: number;\n    readonly h: Float32Array;\n    repose: number;\n    press(x: number, y: number, radius: number, strength: number): Rect | null;\n    pinch(ax: number, ay: number, bx: number, by: number, radius: number, amount: number): Rect | null;\n    smooth(x: number, y: number, radius: number, amount: number): Rect | null;\n    drag(x0: number, y0: number, x1: number, y1: number, radius: number, amount: number): Rect | null;\n    relax(rect?: Rect | null, passes?: number): Rect | null;\n    volume(): number;\n    snapshot(): Float32Array;\n    restore(heights: Float32Array): void;\n    reset(): void;\n};\nexport declare function union(a: Rect | null, b: Rect | null): Rect | null;\nexport declare function createClaySheet(width: number, height: number, opts?: ClayOptions): ClaySheet;"
        }
      ],
      "pitfalls": [
        "Every tool moves clay",
        "Heights and widths share one unit (cells), so a slope is a real slope",
        "Diffusion that keeps volume moves flux between pairs of neighbours, each pair once",
        "A drag carries clay at most a cell a step",
        "Upload only the rows an edit touched",
        "r16float is filterable, r32float is not without the float32-filterable feature",
        "The shading reads the grid with a cubic filter and the shadow with plain bilinear taps",
        "Two touches always squeeze, whatever the tool",
        "One stroke is one undo step",
        "When a tool has nowhere to put what it took (a pinch centred on bare board)",
        "Draw on demand: the tools report what moved and when the clay has settled (busy)"
      ],
      "card": "entries/clay-sheet.json"
    },
    {
      "id": "cloud-shadows",
      "aliases": [],
      "name": "Cloud shadows",
      "summary": "Soft shade drifting over the land with the wind, on everything the sun lights: ground, trees, buildings and people take the same cloud, for one small texture read in each lit pixel and no extra pass. The sun’s own colour is dimmed by a tileable cloud field in world space, read along the sun from the cloud layer’s height, so shadows slant in a low sun and a hilltop sits under another cloud than its foot. Cover, softness, strength and an overcast that puts the whole land in shade are live values; materials that light themselves read the same shade through one node, and the CPU reads it too, for gameplay.",
      "category": "surface",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "calm",
      "tags": [
        "cloud shadows",
        "weather",
        "sky",
        "sunlight",
        "landscape",
        "terrain",
        "open world",
        "wind",
        "drift",
        "overcast",
        "value noise",
        "tileable",
        "light node",
        "colorNode",
        "tsl",
        "cpu query",
        "no pass",
        "no dependencies"
      ],
      "useCases": [
        "an open world or a big landscape that needs weather and life from above",
        "a flight, drone or strategy view over country, farms or a city",
        "an architectural or site model shown on a changing day",
        "gameplay that asks whether a place is in the sun (solar panels, plants, stealth, heat)",
        "an overcast or a passing storm with no sunlit patches left",
        "foliage, water or grass shaders that do their own lighting and should darken with the rest"
      ],
      "interaction": "Click the land or the map to place the marker · drag to orbit · arrow keys on the map move it",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "meadow-grass",
          "why": "Grass the shade drifts over"
        },
        {
          "id": "heightfield-chunks",
          "why": "Ground the shade drifts over"
        },
        {
          "id": "rain-snow",
          "why": "Weather under the same clouds"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 1.213,
          "cpuMs": 0.4,
          "cpuP95Ms": 1.2,
          "badge": "moderate",
          "drawCalls": 13,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 4.478,
            "p99Ms": 16.245,
            "low1Fps": 53.5
          },
          "notes": "Measured drifting at 14 m/s over a 900 m landscape: an 80,000-triangle terrain, 700 trees and 16 houses in two instanced draws, a lake lit by hand that reads the same shade through `sunAt`, a 2048² sun shadow map. Every lit pixel reads the 256² cloud field once."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 7.143,
          "cpuMs": 0.925,
          "cpuP95Ms": 6.815,
          "badge": "heavy",
          "drawCalls": 13,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 1062 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 4.855,
          "cpuMs": 0.44,
          "cpuP95Ms": 0.7,
          "badge": "heavy",
          "drawCalls": 13,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 1392 ms."
        }
      ],
      "signatures": [
        {
          "file": "cloud-shadows.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\nimport { type CloudField, type CloudOptions } from './cloud-field';\ntype F = Node<'float'>;\nexport declare class CloudShadows {\n    readonly field: CloudField;\n    readonly texture: THREE.DataTexture;\n    readonly uniforms: {\n        strength: THREE.UniformNode<'float', number>;\n        cover: THREE.UniformNode<'float', number>;\n        softness: THREE.UniformNode<'float', number>;\n        scale: THREE.UniformNode<'float', number>;\n        height: THREE.UniformNode<'float', number>;\n        offset: THREE.UniformNode<'vec2', THREE.Vector2>;\n        sun: THREE.UniformNode<'vec3', THREE.Vector3>;\n    };\n    speed: number;\n    constructor(options?: Partial<CloudOptions>);\n    densityAt(p?: Node<'vec3'>): F;\n    cloudAt(p?: Node<'vec3'>): F;\n    sunAt(p?: Node<'vec3'>): F;\n    shade(light: THREE.DirectionalLight): THREE.DirectionalLight;\n    setSun(toward: {\n        x: number;\n        y: number;\n        z: number;\n    }): void;\n    update(dt: number, wind?: {\n        x: number;\n        z: number;\n    } | null): void;\n    setStrength(strength: number): void;\n    setCover(cover: number): void;\n    setOvercast(overcast: number): void;\n    sunAtPoint(x: number, y: number, z: number): number;\n    dispose(): void;\n}\nexport {};"
        }
      ],
      "pitfalls": [
        "Call `shade(light)` before the first render that sees the light",
        "Don’t cloud the sun by registering a node on `DirectionalLight` itself",
        "Dim the light, not the frame",
        "A hand-lit material (gpu-foliage’s leaves, a water or grass shader of your own) never sees the…",
        "Keep the field big and slow",
        "Read the field along the sun from the cloud layer, not straight down",
        "A debug view of the field must read it where the shade does",
        "For an overcast, take the cover past 1 (to 1.15), not to 1",
        "Mipmap the field and give it linear filtering"
      ],
      "card": "entries/cloud-shadows.json"
    },
    {
      "id": "colour-picker",
      "aliases": [],
      "name": "Colour picker: HSV and OKLCH, contrast, eyedropper",
      "summary": "A colour picker that does not drift: a saturation × brightness plane or an OKLCH lightness × chroma plane with the edge of sRGB drawn on it, hue and opacity strips, hex, RGB, HSL and OKLCH fields that convert both ways and keep a grey’s hue, CSS Color 4 gamut mapping with a note when a colour had to come in, the browser’s eyedropper where there is one, swatches, recent colours your app stores, and a WCAG 2 contrast readout with AA and AAA. Inline, or as a popover from a swatch button. Plain DOM, no dependencies.",
      "category": "ui",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "colour picker",
        "color picker",
        "oklch",
        "oklab",
        "hsv",
        "hsl",
        "hex",
        "gamut mapping",
        "contrast",
        "wcag",
        "eyedropper",
        "swatches",
        "slider",
        "2d slider",
        "popover",
        "accessibility",
        "keyboard",
        "touch",
        "rtl",
        "dom",
        "canvas2d",
        "no dependencies"
      ],
      "useCases": [
        "theme and brand colour editors",
        "label, tag and calendar colours",
        "drawing and diagram tools",
        "checking text against its background as you choose it",
        "design tokens in OKLCH that stay inside sRGB"
      ],
      "interaction": "Drag the plane and strips, or Tab to them and use the arrows (Shift for bigger steps) · type in any field · open a label’s colour from its button",
      "kits": [
        {
          "kit": "foundations",
          "as": "optional"
        },
        {
          "kit": "product-presentation",
          "as": "optional"
        },
        {
          "kit": "shop",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "chart-access",
          "why": "Check a picked palette stays apart for every reader"
        },
        {
          "id": "appearance-theme",
          "why": "Pick the accent of a theme"
        },
        {
          "id": "property-panel",
          "why": "Its colour field opens the picker"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0.425,
          "cpuP95Ms": 0.55,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the demo turning the hue from the keyboard every frame (Shift and the right arrow on the hue strip, 10° a step) and switching between the OKLCH and HSV planes every 90 frames. In OKLCH each step draws the lightness × chroma plane again (at most 256 pixels across) and traces the edge of sRGB; every step updates the thumbs, the four text fields, the contrast readout and the live preview card. Nothing runs between changes."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.695,
          "cpuP95Ms": 1.095,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 67 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.5,
          "cpuP95Ms": 1.34,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 40 ms."
        }
      ],
      "signatures": [
        {
          "file": "colour-picker.ts",
          "declarations": "import { type Colour, type Format } from './colour';\nimport { type Plane } from './picker-state';\nexport type { Format, Plane, Colour };\nexport type Swatch = string | {\n    value: string;\n    name?: string;\n};\nexport type SwatchState = {\n    value: string;\n    name?: string;\n    colour: Colour;\n    selected: boolean;\n    kind: 'swatch' | 'recent';\n};\nexport type ColourPickerOptions = {\n    value?: string;\n    format?: Format;\n    alpha?: boolean;\n    plane?: Plane;\n    planes?: Plane[];\n    fields?: Format[];\n    swatches?: Swatch[];\n    recent?: string[] | false;\n    recentMax?: number;\n    onRecentChange?: (recent: string[]) => void;\n    contrast?: string | null;\n    eyedropper?: boolean;\n    maxChroma?: number;\n    label?: string;\n    renderSwatch?: (el: HTMLButtonElement, state: SwatchState) => void;\n    onInput?: (value: string, colour: Colour) => void;\n    onChange?: (value: string, colour: Colour) => void;\n    onPlaneChange?: (plane: Plane) => void;\n};\nexport type ColourPicker = {\n    readonly element: HTMLElement;\n    readonly value: string;\n    readonly colour: Colour;\n    readonly plane: Plane;\n    readonly recent: string[];\n    setValue(text: string): boolean;\n    format(format: Format, css?: boolean): string;\n    setContrast(background: string | null): void;\n    setSwatches(swatches: Swatch[]): void;\n    setRecent(recent: string[]): void;\n    setPlane(plane: Plane): void;\n    focus(): void;\n    destroy(): void;\n};\nexport declare function createColourPicker(host: HTMLElement, options?: ColourPickerOptions): ColourPicker;"
        },
        {
          "file": "colour-popover.ts",
          "declarations": "import { type ColourPicker, type ColourPickerOptions } from './colour-picker';\nexport type ColourPopoverOptions = ColourPickerOptions & {\n    dialogLabel?: string;\n    side?: 'top' | 'bottom';\n    align?: 'start' | 'end';\n    chip?: boolean;\n    animate?: (popover: HTMLElement, phase: 'open' | 'close') => Promise<void> | void;\n    onOpen?: () => void;\n    onClose?: (value: string) => void;\n};\nexport type ColourPopover = {\n    readonly button: HTMLButtonElement;\n    readonly popover: HTMLElement;\n    readonly picker: ColourPicker;\n    readonly isOpen: boolean;\n    readonly value: string;\n    setValue(text: string): boolean;\n    open(): void;\n    close(returnFocus?: boolean): Promise<void>;\n    toggle(): void;\n    destroy(): void;\n};\nexport declare function createColourPopover(button: HTMLButtonElement, options?: ColourPopoverOptions): ColourPopover;"
        },
        {
          "file": "colour.ts",
          "declarations": "export type Rgb = {\n    r: number;\n    g: number;\n    b: number;\n};\nexport type Hsv = {\n    h: number;\n    s: number;\n    v: number;\n};\nexport type Hsl = {\n    h: number;\n    s: number;\n    l: number;\n};\nexport type Oklab = {\n    l: number;\n    a: number;\n    b: number;\n};\nexport type Oklch = {\n    l: number;\n    c: number;\n    h: number;\n};\nexport type Format = 'hex' | 'rgb' | 'hsl' | 'oklch';\nexport type Colour = {\n    hex: string;\n    rgb: Rgb;\n    alpha: number;\n    hsv: Hsv;\n    hsl: Hsl;\n    oklch: Oklch;\n};\nexport type Parsed = {\n    space: 'rgb';\n    rgb: Rgb;\n    alpha: number;\n} | {\n    space: 'hsv';\n    hsv: Hsv;\n    alpha: number;\n} | {\n    space: 'oklch';\n    oklch: Oklch;\n    alpha: number;\n};\nexport declare const clamp: (x: number, lo?: number, hi?: number) => number;\nexport declare const wrapHue: (h: number) => number;\nexport declare function toLinear(c: number): number;\nexport declare function toGamma(c: number): number;\nexport declare function linearToOklab(r: number, g: number, b: number): Oklab;\nexport declare function oklabToLinear(L: number, a: number, b: number): [\n    number,\n    number,\n    number\n];\nexport declare function rgbToOklab(rgb: Rgb): Oklab;\nexport declare function rgbToOklch(rgb: Rgb, keepHue?: number): Oklch;\nexport declare function oklchToLinear({ l, c, h }: Oklch): [\n    number,\n    number,\n    number\n];\nexport declare function inGamut(o: Oklch): boolean;\nexport declare function maxChroma(l: number, h: number): number;\nexport declare function oklchToRgb(o: Oklch): Rgb;\nexport declare function toGamut(o: Oklch): {\n    rgb: Rgb;\n    oklch: Oklch;\n};\nexport declare const clampChroma: (o: Oklch) => Oklch;\nexport declare function rgbToHsv({ r, g, b }: Rgb, keep?: {\n    h: number;\n    s: number;\n}): Hsv;\nexport declare function hsvToRgb({ h, s, v }: Hsv): Rgb;\nexport declare function hsvToHsl({ h, s, v }: Hsv): Hsl;\nexport declare function hslToHsv({ h, s, l }: Hsl): Hsv;\nexport declare const rgbToHsl: (rgb: Rgb, keep?: {\n    h: number;\n    s: number;\n}) => Hsl;\nexport declare const hslToRgb: (hsl: Hsl) => Rgb;\nexport declare function parseHex(text: string): {\n    rgb: Rgb;\n    alpha: number;\n} | null;\nexport declare function toHex(rgb: Rgb, alpha?: number): string;\nexport declare function parseColour(text: string, hint?: Format): Parsed | null;\nexport declare function parsedToRgb(p: Parsed): Rgb;\nexport declare function colourOf(rgb: Rgb, alpha?: number, hsv?: Hsv, oklch?: Oklch): Colour;\nexport declare const fix: (x: number, d: number) => string;\nexport declare function formatColour(c: Pick<Colour, 'rgb' | 'alpha' | 'hsv' | 'oklch'>, format: Format, css?: boolean): string;\nexport declare function luminance({ r, g, b }: Rgb): number;\nexport declare function contrastRatio(a: Rgb, b: Rgb): number;\nexport declare function over(fg: Rgb, alpha: number, bg: Rgb): Rgb;\nexport declare function wcagLevels(ratio: number): {\n    aa: boolean;\n    aaa: boolean;\n    aaLarge: boolean;\n    aaaLarge: boolean;\n};\nexport declare const formatRatio: (ratio: number) => string;\nexport declare function describeColour({ l, c, h }: Oklch): string;"
        }
      ],
      "pitfalls": [
        "Feed the value back with setValue as often as you like",
        "Hex is 8-bit",
        "This picker is sRGB only",
        "sRGB’s corners (pure blue most of all) are spikes in OKLCH",
        "Contrast assumes an opaque background",
        "The EyeDropper API exists only in Chromium browsers on desktop (2026), and only from a click",
        "Recent colours count a run of drags and arrow keys as one choice",
        "Import colour-picker.base.css always"
      ],
      "card": "entries/colour-picker.json"
    },
    {
      "id": "comic-text",
      "aliases": [],
      "name": "Comic sound effects and speech balloons",
      "summary": "Sound-effect words that pop with squash and stretch over an inked starburst, speech, thought and shout balloons whose tails keep pointing at their target as it moves, and the halftone and Ben-Day look of old comics in four printing ages. Real text in the DOM, SVG and Canvas 2D behind it, no GPU; restyle it through its parts.",
      "category": "ui",
      "role": "hero-visual",
      "stack": [
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "comics",
        "speech balloons",
        "sound effects",
        "halftone",
        "ben-day dots",
        "svg",
        "canvas 2d",
        "web animations",
        "themes",
        "accessibility",
        "no dependencies"
      ],
      "useCases": [
        "playful onboarding and empty states",
        "game and kids’ interfaces",
        "tooltips with character",
        "celebrating an action (saved, sent, levelled up)",
        "themed landing pages",
        "print-style illustrations"
      ],
      "interaction": "Click anything · drag the heroes or a balloon (double-click it to send it back) · pick an age up top",
      "kits": [],
      "pairsWith": [
        {
          "id": "impact-plates",
          "why": "The page jolts as the word pops"
        },
        {
          "id": "ui-sounds",
          "why": "A synthesised hit under each sound effect"
        },
        {
          "id": "micro-interactions",
          "why": "Toasts and shakes in the same playful voice"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "motion",
          "in": "module",
          "values": {
            "strict": false,
            "playful": true
          },
          "note": "null follows the system setting"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0.365,
          "cpuP95Ms": 0.55,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Fires a sound effect every 0.55 s at a random spot and flies Captain Cache round his panel, so every frame his balloon is re-placed and its tail rebuilt; the other two balloons are only rechecked."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.595,
          "cpuP95Ms": 1.02,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 179 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.54,
          "cpuP95Ms": 0.74,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 133 ms."
        }
      ],
      "signatures": [
        {
          "file": "comic.ts",
          "declarations": "export type Point = {\n    x: number;\n    y: number;\n};\nexport type Target = Element | Point | (() => Element | Point | null) | null;\nexport type BalloonKind = 'speech' | 'thought' | 'shout';\nexport type Side = 'top' | 'bottom' | 'left' | 'right';\nexport type PowStyle = 'yellow' | 'red' | 'white';\nexport type PowOptions = {\n    style?: PowStyle;\n    size?: number;\n    rotate?: number;\n    hold?: number;\n    offset?: Point;\n    burst?: boolean;\n    announce?: boolean;\n};\nexport type BalloonOptions = {\n    kind?: BalloonKind;\n    side?: Side;\n    gap?: number;\n    offset?: Point;\n    at?: Point | null;\n    maxWidth?: number;\n    describe?: boolean;\n    className?: string;\n};\nexport type BalloonSettings = Required<Omit<BalloonOptions, 'className' | 'at'>> & {\n    at: Point | null;\n};\nexport type Balloon = {\n    readonly el: HTMLElement;\n    readonly options: BalloonSettings;\n    readonly text: string;\n    say(text: string): void;\n    point(target: Target): void;\n    moveTo(x: number, y: number): void;\n    follow(side?: Side): void;\n    setKind(kind: BalloonKind): void;\n    readonly centre: Point;\n    remove(): Promise<void>;\n};\nexport type ComicAnimate = (el: HTMLElement, phase: 'enter' | 'exit', part: 'sfx' | 'balloon') => Promise<unknown> | void;\nexport type ComicLayerOptions = {\n    loop?: boolean;\n    animate?: ComicAnimate;\n};\nexport type ComicLayer = {\n    readonly el: HTMLElement;\n    pow(at: Element | Point, text: string, options?: PowOptions): Promise<void>;\n    balloon(target: Target, text: string, options?: BalloonOptions): Balloon;\n    update(): void;\n    motion: boolean | null;\n    stop(): void;\n};\nexport declare function oval(c: Point, a: number, b: number, steps?: number, n?: number): Point[];\nexport declare function burst(c: Point, rx: number, ry: number, spikes: number, inner: number, jit: number, rand: number[], rot?: number): Point[];\nexport declare function cloud(c: Point, a: number, b: number, bump?: number): string;\nexport declare function balloonPath(kind: BalloonKind, w: number, h: number, tip: Point | null, jitter: number[]): {\n    d: string;\n    a: number;\n    b: number;\n};\nexport declare function comicLayer(host: HTMLElement, { loop, animate }?: ComicLayerOptions): ComicLayer;"
        },
        {
          "file": "print.ts",
          "declarations": "export type AgeId = 'golden' | 'silver' | 'noir' | 'manga';\nexport type Age = {\n    id: AgeId;\n    name: string;\n    swatch: string;\n    vars: Record<string, string>;\n    cell: number;\n    mis: number;\n    wear: number;\n    print: 'process' | 'spot';\n};\nexport declare const AGES: Age[];\nexport declare const ageById: (id: string) => Age;\nexport declare function ageAt(el: Element): Age;\nexport declare function onPrint(fn: (root: Element) => void): () => void;\nexport type PrintLook = {\n    readonly age: Age;\n    set(age: AgeId | string): void;\n    stop(): void;\n};\nexport declare function printLook(root: HTMLElement, age?: AgeId | string): PrintLook;\ntype RGB = [\n    number,\n    number,\n    number\n];\nexport declare function rgbOf(colour: string, el: Element): RGB;\nexport declare function dotScreen(ctx: CanvasRenderingContext2D, w: number, h: number, angle: number, cell: number, tone: (x: number, y: number) => number, ox?: number, oy?: number): void;\nexport declare function printInk(ctx: CanvasRenderingContext2D, w: number, h: number, colour: RGB, tone: (x: number, y: number) => number, age: Age, el: Element): void;\nexport type Tone = 'corner' | 'radial' | 'sky' | ((u: number, v: number) => number);\nexport type HalftoneOptions = {\n    colour?: string;\n    tone?: Tone;\n    strength?: number;\n};\nexport type Halftone = {\n    draw(): void;\n    stop(): void;\n};\nexport declare function halftone(el: HTMLElement, options?: HalftoneOptions): Halftone;\nexport {};"
        }
      ],
      "pitfalls": [
        "The tails are rechecked every frame from getBoundingClientRect (the target and the host)",
        "Overlapping body and tail only read as one shape because the path is non-zero and every piece…",
        "The layer is placed in the host’s own pixels and scrolls with it",
        "An SVG mask with maskUnits=\"userSpaceOnUse\" needs its own x, y, width and height",
        "Halftones redraw only on resize and when the age changes",
        "The layer is a polite live region, so every word and balloon is read out",
        "The lettering is the page’s own sans serif at weight 900 (Inter here)"
      ],
      "card": "entries/comic-text.json"
    },
    {
      "id": "command-palette",
      "aliases": [],
      "name": "Command palette",
      "summary": "Ctrl K, ⌘K or / opens a palette of commands, pages and anything else: ranked word matching with the matches highlighted, groups, shortcuts shown beside commands, nested pages (Theme ›, Backspace goes back), recent items with pluggable storage, async searches with a loading row and stale replies dropped, and the WAI-ARIA combobox wiring. Plain DOM, no dependencies; restyle it through its parts.",
      "category": "ui",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "command palette",
        "combobox",
        "listbox",
        "search",
        "fuzzy matching",
        "keyboard",
        "accessibility",
        "aria-activedescendant",
        "async",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "jump to any page or record",
        "run any command without a menu",
        "settings and theme switching",
        "searching people or documents on a server",
        "power users and keyboard-only use"
      ],
      "interaction": "Click in the app, then Ctrl K (⌘K) or / · type, arrows, Enter · Backspace goes back, Esc closes",
      "kits": [
        {
          "kit": "foundations",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "keyboard-shortcuts",
          "why": "Shows each command’s shortcut from one registry"
        },
        {
          "id": "reach-test",
          "why": "Proves every function is in the palette"
        },
        {
          "id": "intent-bar",
          "why": "Sentences when a command name is not enough"
        }
      ],
      "variants": [],
      "version": "1.0.2",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 1.13,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the palette open, typing a new query every eight frames (fourteen in turn, from one letter to a missing word), with the people search answering at once: each step ranks every group, redraws the list and moves the highlight. Closed, it costs nothing."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 1.6,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 118 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 2.54,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 319 ms."
        }
      ],
      "signatures": [
        {
          "file": "command-palette.ts",
          "declarations": "import { type Recent } from './recent';\nexport type PaletteContext = {\n    palette: Palette;\n    query: string;\n    page: PalettePage;\n};\nexport type PaletteItem = {\n    id: string;\n    title: string;\n    subtitle?: string;\n    keywords?: string[];\n    icon?: string;\n    shortcut?: string;\n    disabled?: boolean;\n    keepOpen?: boolean;\n    forget?: boolean;\n    run?(context: PaletteContext): void;\n    page?: PalettePage | (() => PalettePage);\n};\nexport type ItemSource = {\n    group: string;\n    items: readonly PaletteItem[] | (() => readonly PaletteItem[]);\n    limit?: number;\n};\nexport type SearchSource = {\n    group: string;\n    search(query: string, signal: AbortSignal): Promise<readonly PaletteItem[]>;\n    minQuery?: number;\n    debounce?: number;\n    limit?: number;\n    loading?: string;\n    failed?: string;\n};\nexport type PaletteSource = ItemSource | SearchSource;\nexport type PalettePage = {\n    id: string;\n    title: string;\n    placeholder?: string;\n    sources: PaletteSource[];\n};\nexport type PaletteMessages = {\n    label: string;\n    placeholder: string;\n    recent: string;\n    empty(query: string): string;\n    results(count: number): string;\n    page(title: string, count: number): string;\n    back(to: string): string;\n    opens: string;\n    loading: string;\n    failed: string;\n    keys: {\n        move: string;\n        run: string;\n        back: string;\n        close: string;\n    };\n};\nexport type PaletteOptions = {\n    root: PalettePage;\n    container?: HTMLElement;\n    recent?: Recent | null;\n    recentCount?: number;\n    resolve?(id: string): PaletteItem | undefined;\n    fuzzy?: boolean;\n    wrap?: boolean;\n    limit?: number;\n    mac?: boolean;\n    footer?: boolean;\n    messages?: Partial<PaletteMessages>;\n    onRun?(item: PaletteItem, context: PaletteContext): void;\n    onToggle?(open: boolean): void;\n    renderItem?(row: HTMLElement, item: PaletteItem, context: PaletteContext): void;\n    animate?(backdrop: HTMLElement, phase: 'open' | 'close'): Promise<unknown> | void;\n};\nexport type Palette = {\n    readonly element: HTMLElement;\n    readonly isOpen: boolean;\n    open(options?: {\n        page?: PalettePage;\n        query?: string;\n    }): void;\n    close(): void;\n    toggle(): void;\n    setQuery(query: string): void;\n    back(): boolean;\n    refresh(): void;\n    settings: {\n        fuzzy: boolean;\n        wrap: boolean;\n        recentCount: number;\n        limit: number;\n    };\n    dispose(): void;\n};\nexport declare function createPalette(options: PaletteOptions): Palette;\nexport type BindOptions = {\n    target?: EventTarget;\n    keys?: string[];\n    mac?: boolean;\n    stopPropagation?: boolean;\n};\nexport declare function bindPaletteKeys(palette: Palette, { target, keys, mac, stopPropagation }?: BindOptions): () => void;"
        },
        {
          "file": "recent.ts",
          "declarations": "export type RecentStorage = {\n    get(): string | null;\n    set(value: string): void;\n};\nexport type Recent = {\n    list(): string[];\n    add(id: string): void;\n    remove(id: string): void;\n    clear(): void;\n};\nexport declare function memoryStorage(initial?: string | null): RecentStorage;\nexport declare function localStorageAt(key: string): RecentStorage;\nexport declare function readIds(raw: string | null, max: number): string[];\nexport declare function recentList({ storage, max }?: {\n    storage?: RecentStorage;\n    max?: number;\n}): Recent;"
        }
      ],
      "pitfalls": [
        "A whole name typed runs that name",
        "Import command-palette.base.css before command-palette.css (or your own look)",
        "Ctrl K and / may already be taken",
        "Home and End move the highlight, not the caret (Shift+Home still selects the typed text)",
        "Focus stays in the input the whole time",
        "Recent remembers ids",
        "A search source must return quickly to the palette even when it cannot cancel",
        "Shortcuts shown beside commands are labels",
        "Contained in an element (the container option), the backdrop covers that element only"
      ],
      "card": "entries/command-palette.json"
    },
    {
      "id": "comments-tasks",
      "aliases": [],
      "name": "Comments and tasks on anything",
      "summary": "Comment threads pinned to items or to spots, with replies, @mentions (the longest name wins), edit, resolve and reopen; task cards with a status, an assignee, a due date and a checklist, said in one line (“◐ Doing · Anna · due 28 Oct · 2/5”) and moved between kanban columns read by their names; times in words through Intl. Storage is a four-method adapter (a Map store included; Yjs or a server plug in the same way), and a thread panel in plain DOM you can restyle through its parts.",
      "category": "systems",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "comments",
        "threads",
        "mentions",
        "tasks",
        "kanban",
        "checklist",
        "relative time",
        "Intl",
        "collaboration",
        "adapter",
        "combobox",
        "accessibility",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "review comments on designs, boards and documents",
        "pins on a map, an image or a canvas",
        "task cards and a light kanban",
        "feedback threads in an admin tool",
        "collaborative apps on Yjs or a server"
      ],
      "interaction": "Click a pin or a card · click the sketch to comment on a spot · type @ to mention · drag cards between columns (Alt + arrows)",
      "kits": [
        {
          "kit": "dashboard",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "version-history",
          "why": "Threads that survive restoring an older copy"
        },
        {
          "id": "sealed-relay",
          "why": "Live, end-to-end encrypted threads"
        },
        {
          "id": "beside-placement",
          "why": "Threads opened beside the item, never over it"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 1.08,
          "cpuP95Ms": 2.035,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured exercising itself: every frame makes one change through the store (a reply, resolve or reopen, a card moved a column, the clock moved on) and the page redraws its pins, its kanban and the open thread, as it would for a change arriving from someone else."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 2.093,
          "cpuP95Ms": 3.815,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 79 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 1.08,
          "cpuP95Ms": 2.08,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 60 ms."
        }
      ],
      "signatures": [
        {
          "file": "comments.ts",
          "declarations": "import type { CommentStore } from './store';\nexport type Reply = {\n    id: string;\n    author: string;\n    text: string;\n    at: number;\n    edited?: number;\n};\nexport type Thread = {\n    id: string;\n    item: string | null;\n    x: number;\n    y: number;\n    messages: Reply[];\n    resolved: boolean;\n};\nexport type ThreadPlace = {\n    item: string;\n    x?: number;\n    y?: number;\n} | {\n    x: number;\n    y: number;\n};\nexport declare const commentId: () => string;\nexport declare function parseThread(id: string, v: unknown): Thread | null;\nexport declare function readThreads(store: CommentStore): Thread[];\nexport declare const readThread: (store: CommentStore, id: string) => Thread | null;\nexport declare function addThread(store: CommentStore, where: ThreadPlace, author: string, text: string, now?: number): Thread;\nexport declare function reply(store: CommentStore, thread: string, author: string, text: string, now?: number): void;\nexport declare function setResolved(store: CommentStore, thread: string, resolved: boolean): void;\nexport declare function editMessage(store: CommentStore, thread: string, message: string, text: string | null, now?: number): void;\nexport declare function removeThread(store: CommentStore, thread: string): void;\nexport declare function mentions(text: string, known: readonly string[]): string[];\nexport declare function mentionParts(text: string, known: readonly string[]): Array<{\n    text: string;\n    mention?: string;\n}>;\nexport declare function mentionQuery(text: string, caret: number, max?: number): {\n    start: number;\n    query: string;\n} | null;\nexport declare function suggestPeople(query: string, people: readonly string[], limit?: number): string[];\nexport declare function commenters(threads: readonly Thread[]): string[];"
        },
        {
          "file": "store.ts",
          "declarations": "export interface CommentStore {\n    forEach(fn: (value: unknown, id: string) => void): void;\n    get(id: string): unknown;\n    set(id: string, value: unknown): void;\n    delete(id: string): void;\n    subscribe?(listener: () => void): () => void;\n}\nexport type MemoryStore = CommentStore & {\n    subscribe(listener: () => void): () => void;\n    snapshot(): Record<string, unknown>;\n    load(data: Record<string, unknown>): void;\n};\nexport declare function memoryStore(initial?: Record<string, unknown>): MemoryStore;"
        },
        {
          "file": "tasks.ts",
          "declarations": "export type TaskStatus = 'todo' | 'doing' | 'blocked' | 'done';\nexport type CheckItem = {\n    id: string;\n    text: string;\n    done: boolean;\n};\nexport type TaskSpec = {\n    status: TaskStatus;\n    assignee: string;\n    due: string;\n    checklist: CheckItem[];\n};\nexport declare const TASK_STATUSES: readonly {\n    value: TaskStatus;\n    label: string;\n    sign: string;\n}[];\nexport declare const newTask: () => TaskSpec;\nexport declare const checkId: () => string;\nexport declare function parseTask(v: unknown): TaskSpec | null;\nexport declare const progress: (t: TaskSpec) => [\n    number,\n    number\n];\nexport declare function dueIn(t: TaskSpec, today: string): number | null;\nexport declare function dueWords(due: string, locale?: string): string;\nexport declare function taskLine(t: TaskSpec, today: string, locale?: string): {\n    text: string;\n    late: boolean;\n};\nexport declare function statusOfColumn(name: string): TaskStatus | null;\nexport declare function moveToColumn(t: TaskSpec, column: string): TaskSpec;\nexport declare const todayIso: (now?: number) => string;"
        },
        {
          "file": "thread-view.ts",
          "declarations": "import { type Reply, type Thread, type ThreadPlace } from './comments';\nimport type { CommentStore } from './store';\nexport type ThreadEvent = {\n    type: 'created' | 'replied' | 'edited' | 'deleted' | 'resolved' | 'reopened';\n    thread: string;\n    mentioned: string[];\n};\nexport type ThreadViewOptions = {\n    store: CommentStore;\n    me: string;\n    people: readonly string[];\n    now?: () => number;\n    locale?: string;\n    onClose?: () => void;\n    onEvent?: (event: ThreadEvent) => void;\n    describe?: (thread: Thread | null, place: ThreadPlace | null) => string;\n    renderMessage?: (row: HTMLLIElement, message: Reply, thread: Thread) => void;\n};\nexport type ThreadView = {\n    show(thread: string | null): void;\n    compose(place: ThreadPlace): void;\n    current(): string | null;\n    focus(): void;\n    update(options: Partial<ThreadViewOptions>): void;\n    refresh(): void;\n    dispose(): void;\n};\nexport declare const initials: (name: string) => string;\nexport declare const personHue: (name: string) => number;\nexport declare function threadView(el: HTMLElement, initial: ThreadViewOptions): ThreadView;"
        }
      ],
      "pitfalls": [
        "A whole name typed after @ is the one put in. suggestPeople sorts an exact name first",
        "Import comments.base.css, then comments.css (or your own look instead)",
        "Mentions are found by the names you pass (`people`)",
        "The longest name wins: with “Bo” and “Bo Lund” known, “@Bo Lund” mentions only Bo Lund",
        "Store a thread as one value (the functions write the whole thread)",
        "Item pins are a share of the item’s size, so they follow a resize",
        "Due dates are YYYY-MM-DD and compared in UTC with `todayIso()`",
        "Times in words go stale: redraw them when `nextChange()` says (the thread panel does)",
        "Status signs (○ ◐ ■ ●) carry the status besides colour",
        "The thread panel takes Esc for itself"
      ],
      "card": "entries/comments-tasks.json"
    },
    {
      "id": "compile-without-stalls",
      "aliases": [
        "frame-uniforms"
      ],
      "name": "Compile without stalls",
      "summary": "Shaders and pipelines built ahead, never on the frame that first draws something: compile before showing, keep pipelines for kinds that come back, compile see-through materials as drawn, one queue of compiles for the whole page with a guard on the renderer for any compile that skips it, and a counter that names any stall a warm-up missed. When a whole chunk streams in, its CPU work shares one allowance a frame and its meshes’ GPU resources are made a few a frame, hidden until all are ready; a covered view or a bake makes its missing pipelines on the GPU’s workers, never on the spot. And the CPU a frame spends checking uniforms: global values (time, wind, sun, fog) go in three’s shared frame group with one line each, so they are checked once a render instead of once per drawn object and pass, with a live census of the checks (1,200 objects reading 24 globals: CPU 7.5–10.4 ms a frame plain, 4.8–6.9 ms shared).",
      "category": "technique",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "calm",
      "tags": [
        "compileAsync",
        "pipelines",
        "shader warm-up",
        "hitches",
        "streaming",
        "three internals",
        "webgpu",
        "compile queue",
        "black canvas",
        "frame budget",
        "time slicing",
        "gpu resources",
        "bind groups",
        "loading screens",
        "uniforms",
        "frameGroup",
        "cpu cost",
        "draw calls",
        "tsl"
      ],
      "useCases": [
        "open worlds that stream content in",
        "loading screens that really load",
        "first-shot and first-hover hitches",
        "vehicles and glass that stall on first view",
        "perf gates in CI",
        "a chunk of a world arriving without a hitch",
        "one per-frame allowance for many systems’ background work",
        "environment bakes and covered views that never stall the GPU process",
        "scenes with many drawn objects",
        "world-wide wind, time, weather and fog read by every material",
        "cutting CPU time per draw"
      ],
      "interaction": "Watch arrivals and the frame graph · compare compile modes or shared uniforms",
      "kits": [
        {
          "kit": "game",
          "as": "core"
        },
        {
          "kit": "product-presentation",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "segment-loader",
          "why": "Compile each segment ahead within a frame allowance"
        },
        {
          "id": "capability-tiers",
          "why": "Compile only what the tier draws"
        },
        {
          "id": "gltf-motion",
          "why": "Warm a model’s materials before it is shown"
        },
        {
          "id": "rain-snow",
          "why": "Weather values every material reads, in the frame group"
        },
        {
          "id": "cloud-shadows",
          "why": "One sun and wind for every material, in the frame group"
        }
      ],
      "variants": [],
      "version": "1.1.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-17",
          "gpuMs": 0.163,
          "cpuMs": 0.24,
          "cpuP95Ms": 0.365,
          "badge": "light",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.093,
            "p99Ms": 7.025,
            "low1Fps": 137.4
          },
          "notes": "Measured in “compile ahead” mode, a new kind arriving every second and a chunk of 48 rocks every 6 s (built within a 3 ms allowance, 12 a frame to the compile): the counter should stay at 0 mid-run. Measured on the compile part, which opens first; the shared-uniforms part (Part: Shared frame uniforms) runs only while it is shown."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.852,
          "cpuMs": 0.63,
          "cpuP95Ms": 0.87,
          "badge": "moderate",
          "drawCalls": 5,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 114 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 1.301,
          "cpuMs": 0.16,
          "cpuP95Ms": 0.62,
          "badge": "moderate",
          "drawCalls": 3,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 381 ms."
        }
      ],
      "signatures": [
        {
          "file": "compile-as-drawn.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nexport declare function compileAsDrawn(renderer: THREE.WebGPURenderer): boolean;\nexport declare function frozen<T extends THREE.Material>(material: T): T;"
        },
        {
          "file": "compile-count.ts",
          "declarations": "export type CompileCounts = {\n    builds: number;\n    drawnBuilds: number;\n    programs: number;\n    pipelines: number;\n    drawnPipelines: number;\n    computePipelines: number;\n};\ntype Named = {\n    name?: string;\n    parent?: Named | null;\n};\ntype RenderObjectLike = {\n    object?: {\n        name?: string;\n        type?: string;\n        parent?: Named | null;\n        geometry?: {\n            attributes?: Record<string, unknown>;\n        };\n    };\n    material?: {\n        name?: string;\n        type?: string;\n        isShadowPassMaterial?: boolean;\n    };\n};\nexport declare class CompileCounter {\n    readonly counts: CompileCounts;\n    readonly recent: string[];\n    readonly drawnWhileLoading: string[];\n    readonly census: Array<{\n        top: string;\n        object: string;\n        material: string;\n        shadow: boolean;\n        v: number;\n        f: number;\n        drawn: boolean;\n        loading: boolean;\n        state?: string;\n    }>;\n    readonly programCensus: Array<{\n        id: number;\n        stage: string;\n        material: string;\n        length: number;\n        loading: boolean;\n    }>;\n    readonly stages: Map<number, {\n        code?: string;\n    }>;\n    codeOf(id: number): string | null;\n    get marked(): boolean;\n    mark(): void;\n    get sinceMark(): CompileCounts;\n    made(renderObject: RenderObjectLike & {\n        pipeline?: {\n            vertexProgram?: {\n                id: number;\n            };\n            fragmentProgram?: {\n                id: number;\n            };\n        };\n    }, drawn: boolean, state?: string): void;\n    drew(kind: 'build' | 'pipeline', renderObject: RenderObjectLike): void;\n}\nexport declare function countCompiles(renderer: unknown): CompileCounter;\nexport {};"
        },
        {
          "file": "compile-in-turn.ts",
          "declarations": "export type CompileState = {\n    item: object | null;\n    useFrameBufferTarget: boolean;\n    renderTarget: unknown;\n    outputRenderTarget: unknown;\n    activeCubeFace: number;\n    activeMipmapLevel: number;\n    outputMRT: unknown;\n    [more: string]: unknown;\n};\nexport type InTurnRenderer = {\n    _beginPreCompile?: (state: CompileState) => void;\n    _finishPreCompile?: () => void;\n    _precompilationState: CompileState | null;\n    _renderTarget: unknown;\n    _activeCubeFace: number;\n    _activeMipmapLevel: number;\n    _mrt: unknown;\n    _nodes?: {\n        getForRender(renderObject: unknown, yieldFn?: unknown): unknown;\n        getForRenderAsync?: (renderObject: unknown, yieldFn?: unknown) => Promise<unknown>;\n    } | null;\n};\nexport declare function compileInTurn(renderer: object): boolean;\nexport declare function turnsWaited(renderer: object): number;"
        },
        {
          "file": "compile-turn.ts",
          "declarations": "export declare function inTurn<T>(renderer: object, job: () => Promise<T>): Promise<T>;"
        },
        {
          "file": "frame-uniforms.ts",
          "declarations": "export declare const perFrame: <T>(node: T) => T;\nexport declare function lightUniformsPerFrame(node: object): void;"
        },
        {
          "file": "gpu-prep.ts",
          "declarations": "export interface PrepMesh {\n    readonly uuid: string;\n}\nexport declare const PREP_CAP = 12;\nexport declare const PREP_IN_FLIGHT = 24;\nexport declare class GpuPrepQueue<M extends PrepMesh = PrepMesh> {\n    cap: number;\n    inFlight: number;\n    readonly stats: {\n        frames: number;\n        handed: number;\n        most: number;\n    };\n    constructor(compile: (meshes: M[]) => Promise<void>, cap?: number, inFlight?: number);\n    get busy(): number;\n    get size(): number;\n    request(meshes: M[]): Promise<void>;\n    step(cap?: number, inFlight?: number): number;\n    flush(): void;\n}"
        },
        {
          "file": "keep-pipelines.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nexport declare function keepPipelines(renderer: THREE.WebGPURenderer): void;"
        },
        {
          "file": "loading-pipelines.ts",
          "declarations": "export declare function asyncDrawsWhile(renderer: object, loading: () => boolean, pending: (made: Promise<unknown>) => void): boolean;\nexport declare function drawNow<T>(renderer: object, draw: () => T): T;\nexport declare function drawWithoutStalls(renderer: object, draw: () => void): Promise<unknown>[];\nexport declare function bakeWithoutStalls<T>(renderer: object, bake: () => T, discard: (made: T) => void): Promise<T>;"
        },
        {
          "file": "prep-meshes.ts",
          "declarations": "import type * as THREE from 'three/webgpu';\nexport declare function kindOf(mesh: THREE.Mesh): string;\nexport declare function byKind<M extends THREE.Mesh>(meshes: readonly M[]): {\n    first: M[];\n    rest: M[];\n};\nexport declare function prepCompiler(renderer: THREE.WebGPURenderer, camera: THREE.Camera, scene: THREE.Scene): (meshes: THREE.Mesh[]) => Promise<void>;"
        },
        {
          "file": "show-when-compiled.ts",
          "declarations": "import type * as THREE from 'three/webgpu';\nexport declare function showWhenCompiled(renderer: THREE.WebGPURenderer, object: THREE.Object3D, camera: THREE.Camera, scene: THREE.Scene): Promise<void>;"
        },
        {
          "file": "streaming-budget.ts",
          "declarations": "export declare const STREAM_FRAME_MS = 10;\nexport declare const STREAM_BUDGET_MIN = 1;\nexport declare const STREAM_BUDGET_MAX = 3;\nexport interface WorkBudget {\n    open(): boolean;\n    charge(system: string, ms: number): void;\n    now(): number;\n}\nexport interface StreamingFrame {\n    spent: number;\n    allowance: number;\n    unit: number;\n    unitOf: string;\n    by: Record<string, number>;\n}\nexport type StreamingBudgetOptions = {\n    now?: () => number;\n    frameMs?: number;\n    min?: number;\n    max?: number;\n};\nexport declare class StreamingBudget implements WorkBudget {\n    allowance: number;\n    spent: number;\n    fixed: number | null;\n    on: boolean;\n    readonly frames: StreamingFrame[];\n    readonly units: Record<string, {\n        n: number;\n        total: number;\n        worst: number;\n    }>;\n    readonly frameMs: number;\n    readonly min: number;\n    readonly max: number;\n    readonly now: () => number;\n    constructor(options?: StreamingBudgetOptions | (() => number));\n    begin(): void;\n    open(): boolean;\n    charge(system: string, ms: number): void;\n    run<T>(system: string, unit: () => T): T;\n    between<T>(system: string, unit: () => T): T;\n    end(frameMs: number): void;\n    reset(): void;\n}"
        },
        {
          "file": "uniform-census.ts",
          "declarations": "import type * as THREE from 'three/webgpu';\nexport type Census = {\n    checks: number;\n    groups: number;\n    byGroup: Record<string, number>;\n};\nexport declare function uniformCensus(renderer: THREE.WebGPURenderer): {\n    take(): Census | null;\n    stop(): void;\n};"
        }
      ],
      "pitfalls": [
        "A compile that skips the queue (three’s own, another library’s, one the app forgot) can still…",
        "Never run two compileAsync calls on one renderer at once",
        "The queue must be one for the whole page, not one per module",
        "three caches a node build by a key that includes the material and, for an instanced mesh",
        "compileAsync covers only the camera’s pass",
        "three frees pipelines nothing uses",
        "Every vertex attribute is in the pipeline key, read or not",
        "Under 64 KB three writes an instanced mesh’s capacity into its shader",
        "compileAsync (r185+) queues materials, not their state",
        "A hidden mesh is skipped by compileAsync",
        "A skinned mesh’s bone count and its attribute list are in its build key",
        "A chunk warmed all at once makes every mesh’s buffers and bind groups in one frame",
        "Compile one mesh of each kind first and the rest after",
        "Give the background work of every system one allowance a frame (StreamingBudget), not one each",
        "A draw that meets a missing pipeline makes it on the GPU process’s main thread",
        "compileAsync skips what is hidden, so a hidden object is shown for its compile",
        "Frame uniforms are only for values that hold for the whole render",
        "Make a shared uniform once, outside any Fn",
        "A uniform’s group is one bind group per render context and per exact set of uniform nodes",
        "Three’s own light uniforms (colour, reach, decay, cone) sit in each material’s render group",
        "The frame group’s win is per drawn object"
      ],
      "card": "entries/compile-without-stalls.json"
    },
    {
      "id": "compute-gallery",
      "aliases": [],
      "name": "Compute gallery",
      "summary": "A dark exhibition of six WebGPU compute techniques, each a reusable module on its own plinth: a liquid-metal sculpture meshed by marching cubes every frame, liquid in a glass (MLS-MPM particles on a grid; its body drawn from the grid’s column depths, with a meniscus, refraction and a caustic, flat when calm), a million-agent slime mould finding paths between food, Gray–Scott reaction–diffusion raising a knot’s skin, a vase blown into a quarter of a million grains that land back on their exact places, and a bitonic sort that reassembles a scrambled picture pass by pass. One lens and one light for all of them; the camera glides between stations; only the station in view simulates; every pipeline is built at load, and a new element count is rebuilt station by station without a stall. Without WebGPU it shows stills.",
      "category": "simulation",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "expressive",
      "tags": [
        "compute",
        "tsl",
        "marching cubes",
        "indirect draw",
        "atomics",
        "metaballs",
        "mls-mpm",
        "fluid",
        "physarum",
        "slime mould",
        "agents",
        "reaction-diffusion",
        "gray-scott",
        "particles",
        "disintegrate",
        "bitonic sort",
        "gpu sort",
        "storage texture",
        "showcase",
        "gallery",
        "camera glide",
        "bloom",
        "no dependencies"
      ],
      "useCases": [
        "a showcase or attract loop of GPU effects in one world",
        "liquid metal, blobs and morphing sculptures",
        "a liquid that sloshes in a container you can tilt",
        "growing networks, roots, veins and paths between points",
        "organic patterns (coral, stripes, a maze) grown on a mesh",
        "objects that crumble into dust and reform",
        "teaching parallel sorting, or any compute pass you want to see",
        "a gallery or museum layout with stations and a guided camera"
      ],
      "interaction": "Arrows, Page Up/Down or the numbers to travel · drag the metal or the glass · click the dish or the vase",
      "kits": [],
      "pairsWith": [
        {
          "id": "post-stack",
          "why": "Bloom and a grade for the exhibition"
        },
        {
          "id": "camera-director",
          "why": "Move between the plinths as shots"
        },
        {
          "id": "gpu-particles",
          "why": "Another compute core to set on a plinth"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [
          "three/addons RoundedBoxGeometry and BloomNode (the hall and the grade only)"
        ],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 1.603,
          "cpuMs": 0.58,
          "cpuP95Ms": 1.055,
          "badge": "moderate",
          "drawCalls": 24,
          "computeDispatches": 4,
          "frames": null,
          "notes": "Measured touring by itself, a station every 1.6 s (each glide 0.9 s), so the median spans every station; only the station in view (and the one being left, during a glide) simulates. Full element counts."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 7.471,
          "cpuMs": 1.875,
          "cpuP95Ms": 3.045,
          "badge": "heavy",
          "drawCalls": 22,
          "computeDispatches": 1,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 4818 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 11.564,
          "cpuMs": 0.24,
          "cpuP95Ms": 0.42,
          "badge": "heavy",
          "drawCalls": 22,
          "computeDispatches": 1,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 6183 ms."
        }
      ],
      "signatures": [
        {
          "file": "compile-turn.ts",
          "declarations": "export declare function inTurn<T>(renderer: object, job: () => Promise<T>): Promise<T>;"
        },
        {
          "file": "gallery.ts",
          "declarations": "import * as THREE from 'three/webgpu';\ntype Any = any;\nexport type HallOptions = {\n    count: number;\n    spacing?: number;\n    plinth?: number;\n};\nexport type Slot = {\n    top: THREE.Vector3;\n    yaw: number;\n    eye: THREE.Vector3;\n    target: THREE.Vector3;\n};\nexport type Framing = {\n    aim?: number;\n    distance?: number;\n    rise?: number;\n};\nexport declare class Hall {\n    readonly group: THREE.Group<THREE.Object3DEventMap>;\n    readonly slots: Slot[];\n    readonly studio: THREE.Texture;\n    readonly focus: Any;\n    readonly spots: THREE.SpotLight[];\n    constructor(renderer: THREE.WebGPURenderer, { count, spacing, plinth }: HallOptions);\n    frame(i: number, { aim, distance, rise }: Framing): void;\n    setFocus(values: number[]): void;\n    dispose(): void;\n}\nexport {};"
        },
        {
          "file": "glide.ts",
          "declarations": "export type V3 = {\n    x: number;\n    y: number;\n    z: number;\n};\nexport type Pose = {\n    eye: V3;\n    target: V3;\n};\nexport declare const smoother: (t: number) => number;\nexport declare function bezier(p0: V3, p1: V3, p2: V3, p3: V3, t: number): V3;\nexport declare class Glide {\n    eye: V3;\n    target: V3;\n    progress: number;\n    constructor(start: Pose);\n    get moving(): boolean;\n    go(to: Pose, seconds: number): void;\n    update(dt: number): boolean;\n}\nexport declare function drift(pose: Pose, t: number, amount?: number): V3;"
        },
        {
          "file": "grade.ts",
          "declarations": "import * as THREE from 'three/webgpu';\ntype Any = any;\nexport type GradeOptions = {\n    bloom?: number;\n    vignette?: number;\n    grain?: number;\n};\nexport declare class Grade {\n    readonly pipeline: THREE.RenderPipeline;\n    readonly strength: Any;\n    readonly vignette: Any;\n    readonly grain: Any;\n    readonly target: THREE.RenderTarget;\n    constructor(renderer: THREE.WebGPURenderer, scene: THREE.Scene, camera: THREE.Camera, options?: GradeOptions);\n    render(): void;\n    dispose(): void;\n}\nexport {};"
        },
        {
          "file": "marching-cubes.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { NodeMaterial } from 'three/webgpu';\ntype Any = any;\nexport type MarchingCubesOptions = {\n    dims: [\n        number,\n        number,\n        number\n    ];\n    field: Any;\n    spacing: number;\n    origin?: THREE.Vector3Like;\n    iso?: number;\n    capacity?: number;\n    material: NodeMaterial;\n};\nexport declare class MarchingCubes {\n    readonly mesh: THREE.Mesh;\n    readonly iso: Any;\n    readonly passes: THREE.ComputeNode[];\n    readonly capacity: number;\n    readonly cellCount: number;\n    constructor({ dims, field, spacing, origin, iso, capacity, material }: MarchingCubesOptions);\n    dispose(): void;\n}\nexport declare const fieldBuffer: (points: number) => Any;\nexport {};"
        },
        {
          "file": "metaballs.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { PointerPhase, Station, StationStats } from './station';\nexport type MetalFinish = 'chrome' | 'gold' | 'mercury';\nexport type MetaballOptions = {\n    resolution?: number;\n    blobs?: number;\n    finish?: MetalFinish;\n    envMap?: THREE.Texture | null;\n};\nexport declare class MetaballSculpture implements Station {\n    readonly id = \"metaballs\";\n    readonly object: THREE.Group<THREE.Object3DEventMap>;\n    readonly stats: StationStats;\n    readonly material: THREE.MeshPhysicalNodeMaterial;\n    constructor({ resolution, blobs, finish, envMap }?: MetaballOptions);\n    set blobs(value: number);\n    get blobs(): number;\n    set finish(value: MetalFinish);\n    set iso(value: number);\n    compile(renderer: THREE.WebGPURenderer): Promise<void>;\n    update(renderer: THREE.WebGPURenderer, dt: number, time: number): void;\n    pointer(phase: PointerPhase, ray: THREE.Ray): boolean;\n    dispose(): void;\n}"
        },
        {
          "file": "physarum.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { PointerPhase, Station, StationStats } from './station';\nexport type PhysarumOptions = {\n    size?: number;\n    agents?: number;\n    radius?: number;\n    envMap?: THREE.Texture | null;\n};\nexport declare class PhysarumDish implements Station {\n    readonly id = \"physarum\";\n    readonly object: THREE.Group<THREE.Object3DEventMap>;\n    readonly stats: StationStats;\n    readonly sensorAngle: any;\n    readonly sensorDistance: any;\n    readonly turn: any;\n    readonly decay: any;\n    constructor({ size, agents: count, radius, envMap }?: PhysarumOptions);\n    addFood(at: THREE.Vector2): void;\n    clearFood(): void;\n    restart(): void;\n    compile(renderer: THREE.WebGPURenderer): Promise<void>;\n    update(renderer: THREE.WebGPURenderer, dt: number): void;\n    pointer(phase: PointerPhase, ray: THREE.Ray): boolean;\n    dispose(): void;\n}"
        }
      ],
      "pitfalls": [
        "renderer.compileAsync(scene, camera) culls to the camera and builds for the target that is set",
        "A mesh whose vertices come from a storage buffer must not carry a placeholder normal attribute",
        "WebGPU has integer atomics only",
        "Meshing a particle liquid straight from its density looks lumpy",
        "three’s transmission on a liquid inside a transparent glass came out grey and colourless here",
        "compileAsync run in the background",
        "Several dispatches with different uniforms in one frame",
        "Only the station in view simulates",
        "Physarum agents that start in a small ring collapse into one loop",
        "A new element count rebuilds the station in view first, then the others nearest first"
      ],
      "card": "entries/compute-gallery.json"
    },
    {
      "id": "connectors-layouts",
      "aliases": [],
      "name": "Elbow connectors and graph layouts",
      "summary": "Orthogonal connectors routed round every box by A* over a sparse grid, with a bend cost and a tie-break that keeps elbow corners from flipping as things move; ports, rounded corners, arrowheads, labels and marks that keep clear of them; two layouts: layered flows in swimlanes and a balanced two-sided mind map; and for keyboards and screen readers, travel along the lines with each step read out, and the diagram as a table to copy.",
      "category": "data",
      "role": "system",
      "stack": [
        "headless"
      ],
      "character": "calm",
      "tags": [
        "connectors",
        "orthogonal routing",
        "A*",
        "elbow lines",
        "graph layout",
        "Sugiyama",
        "swimlanes",
        "mind map",
        "svg",
        "keyboard",
        "accessibility",
        "screen readers",
        "tables",
        "no dependencies"
      ],
      "useCases": [
        "flowcharts and process maps",
        "node editors",
        "mind maps",
        "org charts and dependency graphs",
        "whiteboards",
        "architecture diagrams",
        "shares, counts and statuses on flow lines",
        "diagrams a keyboard can follow",
        "a diagram as a table for screen readers"
      ],
      "interaction": "Drag steps and watch the lines re-route · drag the board to pan · Tab to a step, arrows move it, N adds one, T follows the lines instead",
      "kits": [],
      "pairsWith": [
        {
          "id": "infinite-canvas",
          "why": "A zoomable board for the boxes it routes"
        },
        {
          "id": "smart-guides",
          "why": "Snap the boxes while the connectors reroute"
        },
        {
          "id": "sankey-flows",
          "why": "Flows when the links carry amounts"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": null,
          "cpuMs": 0.905,
          "cpuP95Ms": 1.825,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured in the layered layout with one step circling through its neighbours, so every frame routes all 12 connectors afresh (A* round all 11 steps each) and redraws them. Idle, nothing moves and nothing is routed: 0 ms."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 1.005,
          "cpuP95Ms": 1.695,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 50 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 2.54,
          "cpuP95Ms": 6.18,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 72 ms."
        }
      ],
      "signatures": [
        {
          "file": "connectors.ts",
          "declarations": "import { type Rect, type Vec2 } from './geometry';\nimport { type RouteOptions } from './router';\nexport type Side = 'n' | 'e' | 's' | 'w';\nexport type Anchor = 'auto' | Side;\nexport type Route = 'elbow' | 'curved' | 'straight';\nexport type End = {\n    anchor: Anchor;\n    x: number;\n    y: number;\n};\nexport type ConnectorLike = {\n    from: End;\n    to: End;\n    route: Route;\n    curve?: number;\n};\nexport type Attachable = Rect;\nexport type Port = {\n    p: Vec2;\n    dir: Vec2 | null;\n};\nexport type ConnectorGeometry = {\n    points: Vec2[];\n    waypoints: Vec2[];\n    start: Port;\n    end: Port;\n    length: number;\n    mid: Vec2;\n    bounds: Rect;\n};\nexport declare const SIDES: readonly Side[];\nexport declare function sidePort(item: Attachable, side: Side): Port;\nexport declare function sideFacing(item: Attachable, towards: Vec2): Side;\nexport declare function sideNear(item: Attachable, p: Vec2, reach: number): Side | null;\nexport declare function facingPoint(item: Attachable, towards: Vec2): Port;\nexport declare const CURVE_DEFAULT = 0.5;\nexport declare function resolvePorts(c: ConnectorLike, fromItem?: Attachable, toItem?: Attachable, rest?: {\n    from?: Attachable;\n    to?: Attachable;\n}): [\n    Port,\n    Port\n];\nexport declare function roundCorners(points: readonly Vec2[], radius: number, steps?: number): Vec2[];\nexport declare function followEnds(corners: readonly Vec2[], a: Vec2, b: Vec2): Vec2[] | null;\nexport declare function connectorGeometry(c: ConnectorLike, fromItem: Attachable | undefined, toItem: Attachable | undefined, obstacles?: readonly Rect[], rest?: {\n    from?: Attachable;\n    to?: Attachable;\n}, routing?: RouteOptions): ConnectorGeometry;\nexport declare function pathLength(points: readonly Vec2[]): number;\nexport declare function pointAt(points: readonly Vec2[], distance: number): Vec2;\nexport type MarkOptions = {\n    at?: number | ((length: number) => number);\n    avoid?: readonly Rect[];\n    gap?: number;\n    ends?: readonly [\n        number,\n        number\n    ];\n};\nexport type MarkSpot = {\n    p: Vec2;\n    distance: number;\n    off: boolean;\n};\nexport declare function markAlong(points: readonly Vec2[], size: {\n    w: number;\n    h: number;\n}, options?: MarkOptions): MarkSpot | null;\nexport declare function trimPath(points: readonly Vec2[], startCut: number, endCut: number): Vec2[];\nexport declare function distanceToPath(points: readonly Vec2[], p: Vec2): number;\nexport declare const capSize: (strokeWidth: number) => {\n    length: number;\n    half: number;\n};\nexport declare function arrowHead(tip: Port, strokeWidth: number): [\n    Vec2,\n    Vec2,\n    Vec2\n];"
        },
        {
          "file": "layered.ts",
          "declarations": "export type Direction = 'right' | 'down' | 'left' | 'up';\nexport type LayoutNode = {\n    id: string;\n    w: number;\n    h: number;\n    lane?: number;\n};\nexport type LayoutEdge = {\n    from: string;\n    to: string;\n};\nexport type LayoutOptions = {\n    direction?: Direction;\n    gapAlong?: number;\n    gapAcross?: number;\n    lanes?: {\n        top: number;\n        height: number;\n    }[];\n};\nexport declare function layoutLayered(nodes: readonly LayoutNode[], edges: readonly LayoutEdge[], o?: LayoutOptions): Map<string, {\n    x: number;\n    y: number;\n}>;"
        },
        {
          "file": "tables.ts",
          "declarations": "import type { FlowGraph } from './travel';\nexport type PlainTable = {\n    title: string;\n    caption?: string;\n    columns: string[];\n    rows: string[][];\n    numeric: boolean[];\n};\nexport declare function table(title: string, columns: string[], rows: string[][], caption?: string): PlainTable;\nexport declare function diagramAsTable(steps: readonly {\n    id: string;\n    name: string;\n    details?: readonly string[];\n}[], graph: FlowGraph, o?: {\n    title?: string;\n    detailColumns?: readonly string[];\n}): PlainTable;\nexport declare function toTsv(t: PlainTable): string;\nexport declare function toCsv(t: PlainTable): string;"
        },
        {
          "file": "travel.ts",
          "declarations": "export type Edge = {\n    from: string;\n    to: string;\n    via: string;\n};\nexport type FlowGraph = {\n    nodes: string[];\n    outs: Map<string, Edge[]>;\n    ins: Map<string, Edge[]>;\n};\nexport type Move = 'next' | 'prev' | 'down' | 'up' | 'right' | 'left';\nexport declare function flowGraph(items: readonly {\n    id: string;\n    kind: string;\n    from?: string | null;\n    to?: string | null;\n}[], rank?: (id: string) => number): FlowGraph;\nexport declare function travel(g: FlowGraph, at: string | null, move: Move, came?: string | null): {\n    to: string;\n    came: string | null;\n} | null;\nexport declare function stopWords(o: {\n    name: string;\n    index: number;\n    count: number;\n    details: readonly string[];\n    from: readonly string[];\n    to: readonly string[];\n}): string;"
        },
        {
          "file": "tree.ts",
          "declarations": "export type TreeNode = {\n    id: string;\n    w: number;\n    h: number;\n    children: TreeNode[];\n};\nexport type Placed = {\n    x: number;\n    y: number;\n    side: 1 | -1;\n};\nexport declare const TREE_GAP_X = 64;\nexport declare const TREE_GAP_Y = 16;\nexport declare function layoutTree(root: TreeNode, cx: number, cy: number, balanced?: boolean): Map<string, Placed>;\nexport declare function buildTree(rootId: string, nodes: ReadonlyMap<string, {\n    w: number;\n    h: number;\n}>, children: ReadonlyMap<string, readonly string[]>): TreeNode;"
        }
      ],
      "pitfalls": [
        "Many routes tie",
        "Route against boxes at rest, not as drawn",
        "Each route builds a grid of (2 × boxes + 3)² points and five headings",
        "Two lines between the same pair route on top of each other",
        "The layered layout lays out along x for direction right",
        "A mark at a fixed place along a line",
        "Routing is not free per frame",
        "Travel follows the lines on show, so build its graph from the same links you draw",
        "A diagram is a picture to a screen reader"
      ],
      "card": "entries/connectors-layouts.json"
    },
    {
      "id": "crowd-bake",
      "aliases": [],
      "name": "Baked GPU crowd",
      "summary": "Thousands of animated figures for the price of a few draws. Each clip of a skinned model is baked once into bone matrices at evenly spaced phases; every figure then sends 64 bytes a frame (where it stands, which way it faces, what it plays, its tint and size), and one instanced draw a kind skins them all in the vertex shader, blending the two baked phases either side and cross-fading from the last clip when it switches. A level of detail is just another kind with the same bake. The bake saves to a small binary with a checked manifest, so it can ship instead of being made at load.",
      "category": "technique",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "calm",
      "tags": [
        "crowd",
        "instancing",
        "skinning",
        "vertex animation",
        "animation baking",
        "bone matrices",
        "storage buffers",
        "cross-fade",
        "level of detail",
        "compileAsync",
        "tsl",
        "webgpu",
        "three.js",
        "no dependencies"
      ],
      "useCases": [
        "crowds in a stadium, a square or a festival",
        "herds, flocks on the ground and other far animals",
        "background people in an architectural walkthrough",
        "armies, queues and audiences in a strategy game or a simulation",
        "far versions of characters that are posed live up close",
        "many copies of an animated machine or prop"
      ],
      "interaction": "Click the plaza to call the crowd over · drag to orbit",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "pose-tiers",
          "why": "Reduce live pose frequency for bodies that still need interaction before handing the far background to baked clips"
        },
        {
          "id": "gltf-motion",
          "why": "Load the skinned model and its clips to bake"
        },
        {
          "id": "humanoid-rig",
          "why": "Full rigs for the few figures close to the camera"
        },
        {
          "id": "walk-grid",
          "why": "Paths for the crowd to walk"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "mixed",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 1.304,
          "cpuMs": 0.752,
          "cpuP95Ms": 0.99,
          "badge": "moderate",
          "drawCalls": 6,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 4.123,
            "p99Ms": 7.11,
            "low1Fps": 133.6
          },
          "notes": "Measured with 4,000 figures in the bake, two kinds (near and far), shadows on: they wander, and every 6 s the crowd is called to a point or scattered, so clips switch and cross-fade throughout."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 7.93,
          "cpuMs": 1.94,
          "cpuP95Ms": 2.325,
          "badge": "heavy",
          "drawCalls": 6,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 488 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 7.569,
          "cpuMs": 2.34,
          "cpuP95Ms": 3.28,
          "badge": "heavy",
          "drawCalls": 6,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 678 ms."
        }
      ],
      "signatures": [
        {
          "file": "bake.ts",
          "declarations": "import { Matrix4, type Object3D, type SkinnedMesh } from 'three';\nexport declare const BONE_FLOATS = 12;\nexport declare const BAKE_BINS = 32;\nexport type ClipSource = {\n    name: string;\n    pose(phase: number): void;\n    cycle?: number;\n    rate?: number;\n    still?: boolean;\n};\nexport type BakedClip = {\n    name: string;\n    cycle: number;\n    rate: number;\n    still: boolean;\n};\nexport type CrowdBake = {\n    bones: number;\n    bins: number;\n    clips: BakedClip[];\n    data: Float32Array;\n};\nexport declare function bakeClips(mesh: SkinnedMesh, root: Object3D, clips: readonly ClipSource[], options?: {\n    bins?: number;\n    bones?: number;\n}): CrowdBake;\nexport declare function sampleBake(bake: CrowdBake, clip: number, phase: number, bone: number, out: Matrix4): Matrix4;\nexport declare const clipIndex: (bake: CrowdBake, name: string) => number;\nexport type BakeManifest = {\n    schemaVersion: 1;\n    kind: 'crowd-bake';\n    format: 'f32-rows-3x4';\n    bones: number;\n    bins: number;\n    clips: BakedClip[];\n    byteLength: number;\n};\nexport declare function bakeManifest(bake: CrowdBake): BakeManifest;\nexport declare function validateBakeManifest(value: unknown): BakeManifest;\nexport declare function readBake(manifest: unknown, binary: ArrayBuffer | ArrayBufferView): CrowdBake;"
        },
        {
          "file": "crowd-batch.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\nimport { type CrowdBake } from './bake';\nimport { type Look, type Place, type Playback, type Tilt } from './playback';\nexport type CrowdKind = {\n    bake: CrowdBake;\n    geometry: THREE.BufferGeometry;\n};\nexport type CrowdBatchOptions = {\n    capacity?: number;\n    colour?: (look: Node<'vec4'>) => Node<'vec3'>;\n    doubleSided?: boolean;\n    textures?: boolean;\n};\nexport declare class CrowdBatch {\n    readonly object3D: THREE.Group<THREE.Object3DEventMap>;\n    readonly material: THREE.MeshStandardNodeMaterial;\n    readonly capacity: number;\n    readonly boneBytes: number;\n    uploaded: number;\n    readonly storage: 'buffers' | 'textures';\n    static needsTextures(renderer: THREE.WebGPURenderer): boolean;\n    constructor(kinds: readonly CrowdKind[], options?: CrowdBatchOptions);\n    setCastShadow(on: boolean): void;\n    get full(): boolean;\n    get placed(): number;\n    place(kind: number, place: Place, play: Playback, look?: Look, tilt?: Tilt): boolean;\n    commit(): number;\n    compile(renderer: THREE.WebGPURenderer, camera: THREE.Camera, scene: THREE.Scene): Promise<void>;\n    dispose(): void;\n}"
        },
        {
          "file": "playback.ts",
          "declarations": "export declare const RECORD_FLOATS = 16;\nexport declare const CROSSFADE = 0.25;\nexport type Playback = {\n    clip: number;\n    phase: number;\n    rate: number;\n    fromClip: number;\n    fromPhase: number;\n    fromRate: number;\n    fade: number;\n};\nexport declare const playback: () => Playback;\nexport declare function playRate(cycle: number, speed: number, onTheSpot: number): number;\nexport declare function playTo(play: Playback, clip: number, phase: number, rate: number, dt: number, fadeSeconds?: number): void;\nexport type Place = {\n    x: number;\n    y: number;\n    z: number;\n    facing: number;\n};\nexport type Tilt = {\n    pitch: number;\n    roll: number;\n};\nexport type Look = {\n    r: number;\n    g: number;\n    b: number;\n    scale: number;\n};\nexport declare function packRecord(into: Float32Array, at: number, place: Place, tilt: Tilt | undefined, play: Playback, clipBase?: number, look?: Look): void;"
        }
      ],
      "pitfalls": [
        "Without WebGPU, pass `textures: CrowdBatch.needsTextures(renderer)` (after `renderer.init()`)",
        "Blending two baked phases blends matrices, not rotations",
        "A cross-fade blends two whole poses the same way",
        "Never an instance count of 0",
        "The batch’s meshes are never frustum culled (their bounds would be one figure’s at the origin)",
        "Build the shaders ahead: `batch.compile(renderer, camera, scene)` shows every kind for one…",
        "Moving clips play at speed / cycle so the feet stay planted",
        "What a bake leaves out: anything that is not the clip, such as heads that turn to look",
        "Every bake in one batch needs the same number of bins",
        "The bake reads the bones’ world matrices"
      ],
      "card": "entries/crowd-bake.json"
    },
    {
      "id": "css-locked-stage",
      "aliases": [],
      "name": "A 3D stage locked to CSS pixels",
      "summary": "A shift-lens camera for a three.js canvas behind the DOM: the plane z = 0 is the page, one world unit a CSS pixel, so a box’s front face drawn at z = 0 lands on its DOM element to the pixel, while everything behind it is a real space in one-point perspective with its vanishing point on the page. The frustum is cut off-axis from wherever the eye stands, so the eye can drift with the pointer or push in toward something: the depth slides in parallax, the page plane never moves. Pure math (no three import), a small binding to a host element, and helpers to place things in DOM wells at any depth.",
      "category": "technique",
      "role": "system",
      "stack": [
        "headless",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "shift lens",
        "off-axis projection",
        "view offset",
        "dom + 3d",
        "pixel-locked",
        "css pixels",
        "one-point perspective",
        "parallax",
        "charts",
        "three.js",
        "webgpu",
        "rests when idle",
        "no dependencies"
      ],
      "useCases": [
        "3D bars and solids that sit exactly on a DOM chart",
        "objects placed in slots of a CSS layout",
        "a page that opens onto a space behind it",
        "pointer parallax without the layout swimming",
        "labels in the DOM, geometry on the GPU",
        "a push-in toward what someone pressed"
      ],
      "interaction": "Move the pointer: the depth slides, the faces stay put · press a bar to push in",
      "kits": [
        {
          "kit": "product-presentation",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "quiet-charts",
          "why": "3D bars standing on the chart’s DOM boxes"
        },
        {
          "id": "world-pinned-labels",
          "why": "HTML labels pinned into the space behind"
        },
        {
          "id": "tilted-dom-gpu",
          "why": "GPU light on panels that tilt in CSS 3D"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "mixed",
        "three": "r187",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-13",
          "gpuMs": 0.459,
          "cpuMs": 0.265,
          "cpuP95Ms": 0.44,
          "badge": "light",
          "drawCalls": 16,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Five extruded bars, a shelf and a hall with grid lines, a 2048 shadow map; the eye drifts round a slow loop as if the pointer moved, so every frame redraws. At rest nothing is drawn."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.835,
          "cpuMs": 0.665,
          "cpuP95Ms": 0.88,
          "badge": "moderate",
          "drawCalls": 16,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 7.297,
            "p99Ms": 9.875,
            "low1Fps": 76.3
          },
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 232 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 1.948,
          "cpuMs": 0.32,
          "cpuP95Ms": 0.46,
          "badge": "moderate",
          "drawCalls": 16,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 576 ms."
        }
      ],
      "signatures": [
        {
          "file": "locked-stage.ts",
          "declarations": "import { wellOf, type DriftOptions, type Eye, type LensCamera, type LensOptions } from './shift-lens';\nexport type LockedStageOptions = LensOptions & {\n    camera: LensCamera;\n    host: HTMLElement;\n    base?: (width: number, height: number) => Eye;\n    parallax?: boolean;\n    drift?: Omit<DriftOptions, 'calm'>;\n    calm?: () => boolean;\n};\nexport type LockedStage = {\n    readonly base: Eye;\n    readonly eye: Eye;\n    readonly width: number;\n    readonly height: number;\n    resize(): void;\n    step(dt: number): boolean;\n    focusOn(x: number, strength: number): void;\n    rectOf(el: Element): ReturnType<typeof wellOf>;\n    at(x: number, y: number, z?: number): [\n        number,\n        number,\n        number\n    ];\n    grow(z: number): number;\n    toScreen(x: number, y: number, z: number): [\n        number,\n        number\n    ];\n    dispose(): void;\n};\nexport declare function createLockedStage({ camera, host, base: baseFor, parallax, drift: driftOptions, calm, ...lens }: LockedStageOptions): LockedStage;"
        },
        {
          "file": "shift-lens.ts",
          "declarations": "export type Eye = {\n    x: number;\n    y: number;\n    d: number;\n};\nexport type Lens = {\n    fov: number;\n    aspect: number;\n    near: number;\n    far: number;\n    position: [\n        number,\n        number,\n        number\n    ];\n    view: [\n        number,\n        number,\n        number,\n        number,\n        number,\n        number\n    ];\n};\nexport type LensCamera = {\n    fov: number;\n    aspect: number;\n    near: number;\n    far: number;\n    position: {\n        set(x: number, y: number, z: number): unknown;\n    };\n    quaternion?: {\n        set(x: number, y: number, z: number, w: number): unknown;\n    };\n    setViewOffset(fullWidth: number, fullHeight: number, x: number, y: number, width: number, height: number): void;\n    updateProjectionMatrix(): void;\n};\nexport type LensOptions = {\n    near?: number;\n    depth?: number;\n};\nexport declare function lensFor(width: number, height: number, eye: Eye, { near, depth }?: LensOptions): Lens;\nexport declare function applyLens(camera: LensCamera, lens: Lens): void;\nexport declare function at(eye: Eye, sx: number, sy: number, z?: number): [\n    number,\n    number,\n    number\n];\nexport declare const grow: (eye: Eye, z: number) => number;\nexport declare function toScreen(eye: Eye, x: number, y: number, z: number): [\n    number,\n    number\n];\nexport type Box = {\n    left: number;\n    top: number;\n    width: number;\n    height: number;\n};\nexport declare function wellOf(r: Box, origin?: {\n    left: number;\n    top: number;\n}): {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n    l: number;\n    t: number;\n    r: number;\n    b: number;\n    cx: number;\n    cy: number;\n};\nexport type Drift = {\n    tx: number;\n    ty: number;\n    x: number;\n    y: number;\n    fx: number;\n    fk: number;\n    ftx: number;\n    ftk: number;\n};\nexport declare const drift: () => Drift;\nexport type DriftOptions = {\n    parallax?: [\n        number,\n        number\n    ];\n    push?: [\n        number,\n        number\n    ];\n    calm?: boolean;\n};\nexport declare function focusOn(d: Drift, x: number, strength: number): void;\nexport declare function stepDrift(d: Drift, dt: number, base: Eye, eye: Eye, width: number, height: number, { parallax, push, calm }?: DriftOptions): boolean;"
        }
      ],
      "pitfalls": [
        "Never turn the camera to look at the page",
        "Units are CSS pixels and world y is down-negative",
        "Read the DOM boxes again after every layout change",
        "The near plane must stay in front of z = 0",
        "The eye’s distance sets the strength of the perspective",
        "A camera from the page’s own setup",
        "Something at depth z looks smaller",
        "Draw on demand: with the eye at rest and nothing laid out again"
      ],
      "card": "entries/css-locked-stage.json"
    },
    {
      "id": "cue-console",
      "aliases": [],
      "name": "Cue engine and operator console",
      "summary": "Runs a live presentation from a cue list: go, back, jump, hold, calm and black, with builds inside a cue, from any clicker, the keyboard or the console. The engine is one pure reducer over timed events, so a recorded rehearsal replays exactly and the state is plain JSON. Two windows keep in step (BroadcastChannel with a heartbeat, postMessage as a second path) and catch up after a reload: the audience screen with no interface, the console with the cue list, a preview of what Go shows next, clocks with overrun, notes, a live finish estimate that says what to skip or stretch, and big Hold and Calm buttons. Presenter and operator roles with a lock; open cue kinds; fully offline. A story flow: interludes (a break, a question from the room) reached only when chosen, which return to the cue and build they left, and a cue the operator arms as next. The stage on the second screen (the Window Management API where allowed, a plain window otherwise) with a live captureStream monitor in the console, or the audience window as a portal: an empty window the console draws into, on one show.",
      "category": "systems",
      "role": "system",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "cue list",
        "show control",
        "presentation",
        "operator console",
        "presenter",
        "clicker",
        "rehearsal",
        "run of show",
        "timing",
        "reducer",
        "event sourcing",
        "deterministic replay",
        "BroadcastChannel",
        "postMessage",
        "two windows",
        "offline",
        "story flow",
        "interlude",
        "armed next",
        "second screen",
        "Window Management API",
        "getScreenDetails",
        "captureStream",
        "program monitor",
        "portal",
        "pop-up window",
        "accessibility",
        "keyboard",
        "rtl",
        "dom",
        "css",
        "no dependencies"
      ],
      "useCases": [
        "live stage shows and talks run from a second screen",
        "a presenter’s clicker and an operator’s console in step",
        "rehearsal timing against the plan",
        "landing a flexible show on time",
        "kiosk and event screens driven from a control window",
        "any two windows kept in step offline",
        "a break or a question from the room that returns to the same slide",
        "the stage window placed on the projector, with a monitor of it on the laptop"
      ],
      "interaction": "Go on the console, Page Down or a click on the audience screen · a cue number and Enter jumps · A arms a cue as next",
      "kits": [],
      "pairsWith": [
        {
          "id": "audio-engine",
          "why": "Music and stings started from cues"
        },
        {
          "id": "lan-remote",
          "why": "Step the show from a phone"
        },
        {
          "id": "slide-show-player",
          "why": "HTML slides as cues"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.01,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the show driving itself: Go every 30 frames from the console, through every build and cue (each press reduced, sent over a BroadcastChannel to the audience pane, drawn there and in the console’s preview), a hold and resume on the questions, then Reset and again. The clocks tick once a second while live; between presses nothing else runs but the one-second heartbeat between the two windows."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 0.01,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 83 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.02,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 53 ms."
        }
      ],
      "signatures": [
        {
          "file": "cue-console.ts",
          "declarations": "import { type Cue, type CueKind, type ShowState } from './cue-engine';\nimport type { CueShow, LinkStatus, Peer } from './cue-link';\nexport type ConsoleLabels = {\n    console: string;\n    phase: {\n        standby: string;\n        live: string;\n        ended: string;\n        hold: string;\n        calm: string;\n        blank: string;\n    };\n    go: string;\n    start: string;\n    show: string;\n    ended: string;\n    back: string;\n    hold: string;\n    calm: string;\n    blank: string;\n    lock: string;\n    print: string;\n    jump: (n: number) => string;\n    cues: string;\n    now: string;\n    next: string;\n    notes: string;\n    finish: string;\n    clocks: {\n        show: string;\n        cue: string;\n        left: string;\n        over: string;\n        finish: string;\n    };\n    link: (status: LinkStatus, peers: readonly Peer[]) => string;\n    driver: (s: ShowState) => string;\n    announce: {\n        cue: (n: number, of: number, label: string) => string;\n        step: (k: number, of: number, label: string) => string;\n        hold: string;\n        resumed: string;\n        calm: string;\n        blank: string;\n        ended: string;\n        refused: string;\n        lock: (on: boolean) => string;\n    };\n    ahead: (ms: number) => string;\n    behind: (ms: number) => string;\n    onTime: string;\n    nothingNext: string;\n    arm: (n: number) => string;\n    disarm: string;\n    interlude: string;\n    armed: string;\n    returns: (where: string) => string;\n    returnNow: string;\n    build: (k: number) => string;\n    monitor: string;\n    monitorNone: string;\n    monitorEnded: string;\n    announceArm: (n: number | null, label: string) => string;\n};\nexport type CueRowInfo = {\n    index: number;\n    status: 'done' | 'live' | 'next' | 'later';\n    selected: boolean;\n    actual: number | null;\n    delta: number | null;\n};\nexport type PreviewView = {\n    cue: Cue | null;\n    index: number;\n    step: number;\n    state: ShowState;\n};\nexport type ConsolePhase = 'cue' | 'step';\nexport type ConsoleOptions = {\n    show: CueShow;\n    title?: string;\n    kinds?: Readonly<Record<string, CueKind>>;\n    endAt?: number | null;\n    length?: number | null;\n    keys?: EventTarget | false;\n    labels?: Partial<ConsoleLabels>;\n    renderPreview?: (el: HTMLElement, view: PreviewView) => void;\n    renderCue?: (row: HTMLElement, cue: Cue, info: CueRowInfo) => void;\n    animate?: (el: HTMLElement, phase: ConsolePhase, detail: {\n        reducedMotion: boolean;\n    }) => Promise<unknown> | void;\n    reducedMotion?: boolean;\n    onPrint?: (html: string) => void;\n    className?: string;\n};\nexport type MonitorSource = HTMLCanvasElement | MediaStream | null;\nexport type CueConsole = {\n    readonly el: HTMLElement;\n    setMonitor(source: MonitorSource, options?: {\n        fps?: number;\n    }): boolean;\n    setTiming(t: {\n        endAt?: number | null;\n        length?: number | null;\n    }): void;\n    refresh(): void;\n    print(): void;\n    destroy(): void;\n};\nexport declare function createCueConsole(host: HTMLElement, options: ConsoleOptions): CueConsole;"
        },
        {
          "file": "cue-engine.ts",
          "declarations": "export type Role = 'presenter' | 'operator';\nexport type Driver = {\n    role: Role;\n    via?: string;\n};\nexport type Cue = {\n    id: string;\n    label: string;\n    kind?: string;\n    target?: number;\n    min?: number;\n    max?: number;\n    optional?: boolean;\n    notes?: string;\n    steps?: string[];\n    flow?: 'main' | 'interlude';\n    group?: string;\n};\nexport type CueKind = {\n    label: string;\n    elastic?: boolean;\n    mark?: string;\n};\nexport declare const CUE_KINDS: Readonly<Record<string, CueKind>>;\nexport declare function kindOf(cue: Cue | undefined, kinds?: Readonly<Record<string, CueKind>>): CueKind;\nexport type Phase = 'standby' | 'live' | 'ended';\nexport type Visit = {\n    cue: number;\n    from: number;\n    to: number | null;\n    held: number;\n};\nexport type ShowState = {\n    v: 1;\n    phase: Phase;\n    cue: number;\n    step: number;\n    hold: boolean;\n    calm: boolean;\n    blank: boolean;\n    lock: boolean;\n    started: number | null;\n    ended: number | null;\n    since: number | null;\n    visits: Visit[];\n    rev: number;\n    at: number;\n    driver: (Driver & {\n        type: ShowEvent['type'];\n        at: number;\n    }) | null;\n    src: string;\n    armed?: number | null;\n    returnTo?: {\n        cue: number;\n        step: number;\n    } | null;\n};\ntype EventBase = {\n    at: number;\n    by?: Driver;\n    src?: string;\n};\nexport type ShowEvent = EventBase & ({\n    type: 'go';\n} | {\n    type: 'back';\n} | {\n    type: 'jump';\n    cue: number;\n    step?: number;\n} | {\n    type: 'hold';\n    on?: boolean;\n} | {\n    type: 'calm';\n    on?: boolean;\n} | {\n    type: 'blank';\n    on?: boolean;\n} | {\n    type: 'resume';\n} | {\n    type: 'lock';\n    on?: boolean;\n} | {\n    type: 'reset';\n} | {\n    type: 'arm';\n    cue: number | null;\n} | {\n    type: 'return';\n} | {\n    type: 'restore';\n    state: ShowState;\n});\ntype Omit2<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;\nexport type Command = Omit2<ShowEvent, 'at' | 'src'>;\nexport declare function initialState(at?: number): ShowState;\nexport declare const paused: (s: ShowState) => boolean;\nexport declare const isInterlude: (cues: readonly Cue[], i: number) => boolean;\nexport declare function flowNext(s: ShowState, cues: readonly Cue[]): {\n    cue: number;\n    step: number;\n} | null;\nexport declare function flowBack(s: ShowState, cues: readonly Cue[]): {\n    cue: number;\n    step: number;\n} | null;\nexport declare function plannedAfter(s: ShowState, cues: readonly Cue[]): number[];\nexport declare function refused(s: ShowState, e: ShowEvent): boolean;\nexport declare function reduce(s: ShowState, e: ShowEvent, cues: readonly Cue[]): ShowState;\nexport declare function replay(events: readonly ShowEvent[], cues: readonly Cue[], from?: ShowState): ShowState;\nexport declare function upNext(s: ShowState, cues: readonly Cue[]): {\n    cue: number;\n    step: number;\n} | null;\nexport type Clocks = {\n    show: number;\n    cue: number;\n    held: number;\n    target: number | null;\n    left: number | null;\n    over: number;\n};\nexport declare function clocks(s: ShowState, cues: readonly Cue[], now: number): Clocks;\nexport declare function formatClock(ms: number, sign?: boolean): string;\nexport {};"
        },
        {
          "file": "cue-link.ts",
          "declarations": "import { type Command, type Cue, type Role, type ShowEvent, type ShowState } from './cue-engine';\nexport type Peer = {\n    id: string;\n    name: string;\n    role: Role;\n    seen: number;\n};\nexport type LinkStatus = 'alone' | 'connected' | 'lost';\nexport type SendResult = 'done' | 'unchanged' | 'refused';\nexport type Change = {\n    event: ShowEvent | null;\n    remote: boolean;\n};\nexport type ShowOptions = {\n    cues: readonly Cue[];\n    channel?: string | null;\n    role?: Role;\n    name?: string;\n    now?: () => number;\n    state?: ShowState;\n    window?: Window | null;\n    heartbeat?: number;\n    timeout?: number;\n    record?: boolean;\n};\nexport type CueShow = {\n    readonly id: string;\n    readonly cues: readonly Cue[];\n    readonly state: ShowState;\n    readonly log: readonly ShowEvent[];\n    readonly peers: readonly Peer[];\n    readonly status: LinkStatus;\n    readonly role: Role;\n    now(): number;\n    send(command: Command): SendResult;\n    allowed(command: Command): boolean;\n    setCues(cues: readonly Cue[]): void;\n    subscribe(fn: (state: ShowState, change: Change) => void): () => void;\n    onPeers(fn: (peers: readonly Peer[], status: LinkStatus) => void): () => void;\n    connect(target: Window): void;\n    open(url: string, target?: string, features?: string): Window | null;\n    destroy(): void;\n};\nexport declare const newer: (a: ShowState, b: ShowState) => boolean;\nexport declare function createCueShow(options: ShowOptions): CueShow;"
        },
        {
          "file": "cue-portal.ts",
          "declarations": "import type { CueShow } from './cue-link';\nimport { type CueStage, type StageOptions } from './cue-stage';\nexport type PortalOptions = {\n    show: CueShow;\n    render?: StageOptions['render'];\n    stage?: Omit<StageOptions, 'show' | 'render'>;\n    title?: string;\n    css?: string;\n    copyStyles?: boolean;\n    target?: string;\n    features?: string;\n    closeWithOpener?: boolean;\n    onClose?: () => void;\n    window?: Window;\n};\nexport type AudiencePortal = {\n    readonly window: Window;\n    readonly stage: CueStage;\n    readonly closed: boolean;\n    fullscreen(): Promise<boolean>;\n    close(): void;\n    destroy(): void;\n};\nexport declare function openAudiencePortal(options: PortalOptions): AudiencePortal | null;"
        },
        {
          "file": "cue-screens.ts",
          "declarations": "export type ScreenInfo = {\n    left: number;\n    top: number;\n    width: number;\n    height: number;\n    label: string;\n    primary: boolean;\n};\nexport type Placement = {\n    where: 'second-screen';\n    screen: ScreenInfo;\n} | {\n    where: 'window';\n    reason: 'one-screen' | 'no-api' | 'refused' | 'failed';\n} | {\n    where: 'blocked';\n};\nexport type OpenStage = (url: string, target: string, features: string) => Window | null;\nexport type ScreenOpenOptions = {\n    target?: string;\n    open?: OpenStage;\n    width?: number;\n    height?: number;\n    ask?: boolean;\n};\nexport type ScreenPlanner = {\n    readonly screens: 'extended' | 'single' | 'unknown';\n    readonly permission: PermissionState | 'unsupported';\n    readonly other: ScreenInfo | null;\n    open(url: string, options?: ScreenOpenOptions): {\n        window: Window | null;\n        placed: Promise<Placement>;\n    };\n    onChange(fn: () => void): () => void;\n    destroy(): void;\n};\nexport declare function createScreenPlanner(win?: Window): ScreenPlanner;\nexport declare function describePlacement(p: Placement): string;"
        },
        {
          "file": "cue-stage.ts",
          "declarations": "import type { Cue, Driver, ShowState } from './cue-engine';\nimport type { CueShow } from './cue-link';\nexport type StageChange = 'cue' | 'step' | 'phase' | 'hold' | 'calm' | 'cues';\nexport type StageView = {\n    cue: Cue | null;\n    index: number;\n    step: number;\n    state: ShowState;\n    changed: ReadonlySet<StageChange>;\n};\nexport type StageOptions = {\n    show: CueShow;\n    render?: (el: HTMLElement, view: StageView) => void;\n    keys?: EventTarget | false;\n    pointer?: boolean;\n    fullscreen?: boolean;\n    hideCursor?: number;\n    label?: string;\n    driver?: Driver;\n};\nexport type CueStage = {\n    readonly el: HTMLElement;\n    readonly scene: HTMLElement;\n    refresh(): void;\n    destroy(): void;\n};\nexport declare function createCueStage(host: HTMLElement, options: StageOptions): CueStage;"
        },
        {
          "file": "cue-timing.ts",
          "declarations": "import { type Cue, type CueKind, type ShowState } from './cue-engine';\ntype Kinds = Readonly<Record<string, CueKind>>;\nexport declare function bounds(cue: Cue, kinds?: Kinds): {\n    target: number;\n    min: number;\n    max: number;\n    elastic: boolean;\n};\nexport type RehearsalRow = {\n    index: number;\n    id: string;\n    label: string;\n    target: number | null;\n    actual: number;\n    held: number;\n    visits: number;\n    delta: number | null;\n};\nexport declare function rehearsal(s: ShowState, cues: readonly Cue[], now?: number): {\n    rows: RehearsalRow[];\n    actual: number;\n    held: number;\n    target: number;\n};\nexport type Suggestion = {\n    cue: number;\n    action: 'skip' | 'shorten' | 'stretch';\n    by: number;\n    to: number;\n};\nexport type Schedule = {\n    estimate: number;\n    endAt: number | null;\n    delta: number | null;\n    suggestions: Suggestion[];\n    covered: boolean;\n    absorb: {\n        shrink: number;\n        stretch: number;\n    };\n};\nexport declare function schedule(s: ShowState, cues: readonly Cue[], now: number, options?: {\n    endAt?: number | null;\n    kinds?: Kinds;\n    tolerance?: number;\n}): Schedule;\nexport declare function describe(sg: Suggestion, cues: readonly Cue[]): string;\nexport type RunRow = {\n    n: number;\n    id: string;\n    label: string;\n    kind: string;\n    start: number;\n    target: number;\n    min: number;\n    max: number;\n    optional: boolean;\n    actual: number | null;\n    delta: number | null;\n    notes: string;\n    interlude: boolean;\n};\nexport declare function runOfShow(cues: readonly Cue[], s?: ShowState, kinds?: Kinds): RunRow[];\nexport declare function runOfShowText(rows: readonly RunRow[], title?: string): string;\nexport declare function runOfShowHtml(rows: readonly RunRow[], title?: string): string;\nexport {};"
        }
      ],
      "pitfalls": [
        "Both windows must be the same origin (and the same browser profile) for BroadcastChannel",
        "Two presses within a few milliseconds in two windows make two different revisions",
        "The clock is Date.now by default, shared by every window on one machine",
        "The audience window can only go full screen from a press in that window (browser rule)",
        "Keep the show state yourself if a reload of both windows at once must survive",
        "In standby the cover is black at 99.6 % opacity, so the first cue is drawn under it and warm",
        "Locked, a presenter’s clicker can still go, go back and black the screen, but cannot jump, hold",
        "The heartbeat runs once a second only while another window is known",
        "Import cue-console.base.css before cue-console.css",
        "An interlude returns to the cue and build it left",
        "Interludes are not part of the plan",
        "Open the stage window inside the click",
        "Placing windows on screens needs Chrome or Edge, a secure context",
        "The monitor copies a canvas",
        "A portal runs no code of its own",
        "A portal lives and dies with the page that draws it"
      ],
      "card": "entries/cue-console.json"
    },
    {
      "id": "data-table",
      "aliases": [],
      "name": "Data table: sort, sticky header, virtual rows",
      "summary": "A real <table> that holds up with 100,000 rows: only the rows in view are in the DOM (uniform or measured heights, scroll position kept), a sticky header and first column, stable multi-column sorting with aria-sort and spoken results, locale-aware comparing, column resizing by pointer and keyboard, Shift-range selection, pages or infinite loading, and empty, loading and error states, and cells edited in place through one field floating over the cell. Plain TypeScript and CSS; restyle it through its parts.",
      "category": "data",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "table",
        "virtual scrolling",
        "sorting",
        "multi-sort",
        "Intl.Collator",
        "column resize",
        "selection",
        "pagination",
        "infinite scroll",
        "IntersectionObserver",
        "inline editing",
        "editable cells",
        "accessibility",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "admin and back-office lists",
        "reports and exports",
        "search results",
        "logs and audit trails",
        "anything with more rows than a page can hold",
        "changing a few values in place (a number, an owner)"
      ],
      "interaction": "Click a header to sort, Shift-click to add it · drag a header’s edge (or arrow keys on it) to resize · Shift-click boxes for a range · click an owner or units to change it",
      "kits": [
        {
          "kit": "foundations",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "streaming-spreadsheets",
          "why": "Fill it from huge CSV and Excel files"
        },
        {
          "id": "loading-states",
          "why": "Loading, empty and error states around it"
        },
        {
          "id": "weight-glyphs",
          "why": "Values carried by type weight in dense columns"
        }
      ],
      "variants": [],
      "version": "1.2.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0.22,
          "cpuP95Ms": 0.315,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with 100,000 rows in virtual mode while the demo drives itself: it scrolls the table every frame (about 40 px, each frame drawing the rows that came into view) and sorts by another column every 90 frames (each column’s ranks are cached after its first sort)."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.305,
          "cpuP95Ms": 0.465,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 214 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.52,
          "cpuP95Ms": 0.76,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 116 ms."
        }
      ],
      "signatures": [
        {
          "file": "cell-edit.ts",
          "declarations": "import type { Column } from './data-table';\nexport { cellKey } from './cell-edit-model';\nexport type EditableCell<R> = {\n    text: (row: R) => string;\n    shown?: (row: R) => string;\n    unit?: (row: R) => string;\n    label: (row: R) => string;\n    fieldLabel?: (row: R) => string;\n    editable?: (row: R) => boolean;\n    check?: (text: string, row: R) => string | null | undefined | void;\n    commit: (row: R, text: string) => void;\n};\nexport type CellEditingOptions<R, K> = {\n    rowKey: (row: R) => K;\n    minWidth?: number;\n    onEdit?: (key: string | null) => void;\n};\nexport type CellEditing<R, K> = {\n    render(columnId: string, cell: EditableCell<R>): NonNullable<Column<R>['render']>;\n    readonly open: string | null;\n    start(columnId: string, key: K): boolean;\n    finish(keep: boolean): void;\n    dispose(): void;\n};\nexport declare function createCellEditing<R, K>(host: HTMLElement, o: CellEditingOptions<R, K>): CellEditing<R, K>;"
        },
        {
          "file": "data-table.ts",
          "declarations": "import { type CellValue, type SortDir, type SortKey, type ValueType } from './table-model';\nexport type { CellValue, SortDir, SortKey, ValueType } from './table-model';\nexport type Column<R> = {\n    id: string;\n    header: string;\n    value: (row: R) => CellValue;\n    type?: ValueType;\n    format?: (value: CellValue, row: R) => string;\n    render?: (cell: HTMLTableCellElement, value: CellValue, row: R) => void;\n    width?: number;\n    minWidth?: number;\n    maxWidth?: number;\n    align?: 'start' | 'end' | 'center';\n    sortable?: boolean;\n    firstSort?: SortDir;\n    wrap?: boolean;\n};\nexport type Paging = 'none' | 'pages' | 'infinite';\nexport type DataTableOptions<R, K> = {\n    columns: Column<R>[];\n    rows?: R[];\n    caption: string;\n    rowKey?: (row: R, index: number) => K;\n    rowLabel?: (row: R) => string;\n    rowHeight?: number | 'measure';\n    overscan?: number;\n    stickyFirst?: boolean;\n    selectable?: boolean;\n    paging?: Paging;\n    pageSize?: number;\n    loadMore?: () => Promise<R[] | null | undefined>;\n    hasMore?: boolean;\n    sorting?: 'local' | 'external';\n    sort?: SortKey[];\n    locale?: string | string[];\n    empty?: string | (() => Node);\n    onSortChange?: (sort: SortKey[]) => void;\n    onSelectionChange?: (selected: ReadonlySet<K>) => void;\n    onColumnResize?: (id: string, width: number) => void;\n    announce?: (text: string) => void;\n};\nexport type DataTable<R, K> = {\n    readonly region: HTMLElement;\n    readonly selected: ReadonlySet<K>;\n    setRows(rows: R[], options?: {\n        hasMore?: boolean;\n    }): void;\n    appendRows(rows: R[], hasMore?: boolean): void;\n    getSort(): SortKey[];\n    setSort(sort: SortKey[]): void;\n    select(keys: Iterable<K>, on?: boolean): void;\n    selectAll(on: boolean): void;\n    setLoading(on: boolean): void;\n    page(): {\n        page: number;\n        pages: number;\n    };\n    setPage(page: number): void;\n    setOptions(options: {\n        stickyFirst?: boolean;\n        rowHeight?: number | 'measure';\n    }): void;\n    scrollToRow(position: number): void;\n    widths(): Record<string, number>;\n    refresh(): void;\n    redraw(): void;\n    dispose(): void;\n};\nexport declare function createDataTable<R, K = number>(host: HTMLElement, options: DataTableOptions<R, K>): DataTable<R, K>;"
        }
      ],
      "pitfalls": [
        "Import data-table.base.css, then data-table.css (or your own look instead)",
        "Give the host a height (or put it in a flex or grid cell that has one)",
        "rowKey must be stable (an id)",
        "A numeric rowHeight promises every row is that tall",
        "Browsers cap an element’s height (Chrome about 33 million pixels, Firefox about 17 million)",
        "The first sort by a text column with many distinct words takes the longest",
        "With virtual rows, Ctrl F and a screen reader’s table keys see only the rows drawn.…",
        "With infinite loading and local sorting, rows that arrive are sorted into place",
        "Selection is kept by key and pruned on setRows",
        "A column’s render must reuse the control already in its cell (cell-edit.ts does)",
        "Never put an <input> in a cell to edit it",
        "Find the cell again by its key (column and row), never by its words",
        "A value changed in place (a cell edited) is not re-sorted until the next sort or setRows",
        "Cells cut with an ellipsis show their whole text as a tooltip on hover"
      ],
      "card": "entries/data-table.json"
    },
    {
      "id": "date-picker",
      "aliases": [],
      "name": "Date picker: calendar, range and field",
      "summary": "A date (and optional time) picker as an inline calendar or a popover from a text field, which becomes a bottom sheet on a phone. One day, a range with a hover preview and presets (\"Last 7 days\"), or several days; min, max and a disabled(date) callback; ISO week numbers; month and year lists for quick jumps. Locale-aware through Intl: names, digits, the first day of the week and the order people type in, read back as typed as well as ISO, and the field keeps what was typed until it is a real day. The date maths runs on plain { y, m, d } values, so no time zone or clock change can move a day.",
      "category": "ui",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "date picker",
        "calendar",
        "date range",
        "time picker",
        "datepicker dialog",
        "grid",
        "intl",
        "locale",
        "week numbers",
        "iso 8601",
        "bottom sheet",
        "popover",
        "accessibility",
        "keyboard",
        "touch",
        "rtl",
        "dom",
        "css",
        "no dependencies"
      ],
      "useCases": [
        "dates in forms (a due date, a birthday, an appointment)",
        "report and filter periods with presets",
        "booking several days or a stay",
        "an appointment with a time in steps",
        "an always-visible calendar in a side panel"
      ],
      "interaction": "Pick a range on the calendar (the second end previews under the pointer) · type or open a field · arrows, Page Up/Down, Home/End, Enter, Esc",
      "kits": [
        {
          "kit": "foundations",
          "as": "optional"
        },
        {
          "kit": "dashboard",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "steady-fields",
          "why": "Its field keeps a draft and its error like the rest"
        },
        {
          "id": "meeting-scheduler",
          "why": "Free slots across time zones for the picked range"
        },
        {
          "id": "accessible-dialog",
          "why": "Its phone sheet follows the same focus rules"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.46,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the demo driving itself, one step every 10 frames: it opens the Date field’s popover, moves the focus with the arrow keys and Page Up and Down (a month’s grid redrawn each time), closes it, then picks a range on the inline two-month calendar with the preview following the pointer across days, pages the months on and back, and types a date into a field. Nothing runs between steps."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 1.17,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 92 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 2.1,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 73 ms."
        }
      ],
      "signatures": [
        {
          "file": "date-math.ts",
          "declarations": "export type PlainDate = {\n    y: number;\n    m: number;\n    d: number;\n};\nexport type PlainTime = {\n    h: number;\n    min: number;\n};\nexport type PlainDateTime = PlainDate & PlainTime;\nexport type DateRange = {\n    start: PlainDate;\n    end: PlainDate;\n};\nexport declare const isLeapYear: (y: number) => boolean;\nexport declare const daysInMonth: (y: number, m: number) => number;\nexport declare function isValidDate(v: unknown): v is PlainDate;\nexport declare const dateOf: (v: PlainDate) => PlainDate;\nexport declare function toDays({ y, m, d }: PlainDate): number;\nexport declare function fromDays(n: number): PlainDate;\nexport declare const dayOfWeek: (v: PlainDate) => number;\nexport declare const addDays: (v: PlainDate, n: number) => PlainDate;\nexport declare function addMonths(v: PlainDate, n: number): PlainDate;\nexport declare const addYears: (v: PlainDate, n: number) => PlainDate;\nexport declare const diffDays: (a: PlainDate, b: PlainDate) => number;\nexport declare function compare(a: PlainDate, b: PlainDate): -1 | 0 | 1;\nexport declare const sameDay: (a: PlainDate | null | undefined, b: PlainDate | null | undefined) => boolean;\nexport declare const sameMonth: (a: PlainDate, b: PlainDate) => boolean;\nexport declare const minDate: (a: PlainDate, b: PlainDate) => PlainDate;\nexport declare const maxDate: (a: PlainDate, b: PlainDate) => PlainDate;\nexport declare function clampDate(v: PlainDate, min?: PlainDate | null, max?: PlainDate | null): PlainDate;\nexport declare const startOfMonth: (v: PlainDate) => PlainDate;\nexport declare const endOfMonth: (v: PlainDate) => PlainDate;\nexport declare const startOfWeek: (v: PlainDate, firstDay: number) => PlainDate;\nexport declare const endOfWeek: (v: PlainDate, firstDay: number) => PlainDate;\nexport declare function isoWeek(v: PlainDate): {\n    year: number;\n    week: number;\n};\nexport declare function monthGrid(y: number, m: number, firstDay: number, weeks?: number): PlainDate[][];\nexport declare const rangeOf: (a: PlainDate, b: PlainDate) => DateRange;\nexport declare const inRange: (v: PlainDate, r: DateRange | null | undefined) => boolean;\nexport declare const rangeLength: (r: DateRange) => number;\nexport declare function addMinutes(v: PlainDateTime, n: number): PlainDateTime;\nexport declare const snapMinutes: (min: number, step: number) => number;\nexport declare const toISO: (v: PlainDate) => string;\nexport declare const toISODateTime: (v: PlainDateTime) => string;\nexport declare function parseISO(text: string): PlainDate | PlainDateTime | null;\nexport declare const fromJSDate: (date: Date) => PlainDate;\nexport declare function toJSDate(v: PlainDate & Partial<PlainTime>): Date;\nexport declare const today: (now?: Date) => PlainDate;"
        },
        {
          "file": "date-picker.ts",
          "declarations": "import { type DateRange, type PlainDate, type PlainDateTime, type PlainTime } from './date-math';\nimport { type Limits, type Preset } from './model';\nexport declare const STRINGS: {\n    dialog: string;\n    choose: string;\n    change: (date: string) => string;\n    prevMonth: string;\n    nextMonth: string;\n    prevYear: string;\n    nextYear: string;\n    prevYears: string;\n    nextYears: string;\n    pickMonth: string;\n    pickYear: string;\n    backToDays: string;\n    today: string;\n    clear: string;\n    done: string;\n    presets: string;\n    week: string;\n    weekShort: string;\n    time: string;\n    hours: string;\n    minutes: string;\n    selected: (date: string) => string;\n    rangeStart: (date: string) => string;\n    range: (from: string, to: string, days: number) => string;\n    added: (date: string, count: number) => string;\n    removed: (date: string, count: number) => string;\n    cleared: string;\n};\nexport type Strings = typeof STRINGS;\nexport type TimeOptions = {\n    step?: number;\n    hour12?: boolean;\n    default?: PlainTime;\n};\nexport type MotionPhase = 'open' | 'close' | 'next' | 'prev';\nexport type DayInfo = {\n    cell: HTMLTableCellElement;\n    outside: boolean;\n    today: boolean;\n    disabled: boolean;\n    weekend: boolean;\n    label: string;\n};\nexport type InvalidReason = 'format' | 'unavailable';\ntype Common = Limits & {\n    locale?: string;\n    firstDay?: number;\n    weekNumbers?: boolean;\n    months?: number;\n    outsideDays?: boolean;\n    label?: string;\n    strings?: Partial<Strings>;\n    today?: () => PlainDate;\n    todayButton?: boolean;\n    clearable?: boolean;\n    reducedMotion?: boolean;\n    className?: string;\n    renderDay?(content: HTMLElement, date: PlainDate, day: DayInfo): void;\n    animate?(el: HTMLElement, phase: MotionPhase): Promise<void> | void;\n    button?: HTMLButtonElement | false;\n    anchor?: HTMLElement;\n    container?: HTMLElement | ShadowRoot;\n    sheet?: 'auto' | 'always' | 'never';\n    sheetQuery?: string;\n    onOpen?(): void;\n    onClose?(): void;\n    onInvalid?(text: string, reason: InvalidReason): void;\n};\ntype Valued<V, P> = {\n    value?: V;\n    defaultValue?: V;\n    onChange?(value: V): void;\n    presets?: Preset<P>[];\n};\nexport type SingleOptions = Common & Valued<PlainDate | null, PlainDate> & {\n    mode?: 'single';\n    time?: false;\n};\nexport type DateTimeOptions = Common & Valued<PlainDateTime | null, PlainDateTime> & {\n    mode?: 'single';\n    time: true | TimeOptions;\n};\nexport type RangeOptions = Common & Valued<DateRange | null, DateRange> & {\n    mode: 'range';\n};\nexport type MultipleOptions = Common & Valued<PlainDate[], PlainDate[]> & {\n    mode: 'multiple';\n};\nexport type DatePickerOptions = SingleOptions | DateTimeOptions | RangeOptions | MultipleOptions;\nexport type LiveOptions = Omit<Common, 'button' | 'anchor' | 'container'> & {\n    presets?: Preset<PlainDate | PlainDateTime | DateRange | PlainDate[]>[];\n};\nexport type DatePicker<V> = {\n    readonly element: HTMLElement;\n    readonly popover: HTMLElement | null;\n    readonly value: V;\n    setValue(value: V, opts?: {\n        notify?: boolean;\n    }): void;\n    readonly isOpen: boolean;\n    open(): void;\n    close(): void;\n    goTo(date: PlainDate): void;\n    focus(): void;\n    setOptions(options: LiveOptions): void;\n    destroy(): void;\n};\nexport declare function createDatePicker(target: HTMLElement, options?: SingleOptions): DatePicker<PlainDate | null>;\nexport declare function createDatePicker(target: HTMLElement, options: DateTimeOptions): DatePicker<PlainDateTime | null>;\nexport declare function createDatePicker(target: HTMLElement, options: RangeOptions): DatePicker<DateRange | null>;\nexport declare function createDatePicker(target: HTMLElement, options: MultipleOptions): DatePicker<PlainDate[]>;\nexport {};"
        },
        {
          "file": "model.ts",
          "declarations": "import { type DateRange, type PlainDate } from './date-math';\nexport type Mode = 'single' | 'range' | 'multiple';\nexport type Limits = {\n    min?: PlainDate | null;\n    max?: PlainDate | null;\n    disabled?: ((date: PlainDate) => boolean) | null;\n};\nexport declare const isUnavailable: (v: PlainDate, l: Limits) => boolean;\nexport declare function moveByKey(from: PlainDate, key: string, opts: {\n    shift?: boolean;\n    rtl?: boolean;\n    firstDay: number;\n} & Limits): PlainDate | null;\nexport declare function viewFor(focus: PlainDate, view: PlainDate, count: number): PlainDate;\nexport type Selection = {\n    mode: Mode;\n    single: PlainDate | null;\n    range: DateRange | null;\n    many: PlainDate[];\n    anchor: PlainDate | null;\n};\nexport declare const emptySelection: (mode: Mode) => Selection;\nexport type PickResult = {\n    selection: Selection;\n    changed: boolean;\n    done: boolean;\n};\nexport declare function pick(s: Selection, v: PlainDate): PickResult;\nexport type DayState = {\n    selected: boolean;\n    band: 'start' | 'end' | 'both' | 'middle' | null;\n    preview: boolean;\n};\nexport declare const keySet: (many: PlainDate[]) => Set<string>;\nexport declare function dayState(v: PlainDate, s: Selection, hover: PlainDate | null, many?: Set<string>): DayState;\nexport declare function initialFocus(s: Selection, today: PlainDate, l: Limits): PlainDate;\nexport type Preset<V> = {\n    label: string;\n    value: V | (() => V);\n};\nexport declare function rangePresets(today: PlainDate, labels?: [\n    string,\n    string,\n    string,\n    string,\n    string,\n    string\n]): Preset<DateRange>[];\nexport declare const yearPage: (y: number) => number;"
        }
      ],
      "pitfalls": [
        "Values are plain { y, m, d } days (months from 1), not Date objects",
        "The field shows text for people in the locale’s order",
        "\"Today\" is the browser’s day",
        "Typing commits only a complete day with a four-digit year",
        "Controlled use (value given)",
        "A range may span disabled days (a weekend inside a week off)",
        "The popover is position: fixed in document.body (or the input’s shadow root)",
        "The popover takes the field’s direction, lang",
        "Week numbers are ISO 8601 (Monday weeks)",
        "Times are wall-clock hours and minutes with no zone"
      ],
      "card": "entries/date-picker.json"
    },
    {
      "id": "day-timeline",
      "aliases": [],
      "name": "Day timeline and scrubber",
      "summary": "A day or a shift as rows of spans under an hour axis, a line for now, and a handle you drag along the day (or move with the keys) to look at another moment: a real slider for a screen reader, saying what is happening then. Positions are fractions in CSS, so it follows its box with no redraw; it scrolls sideways rather than squeezing the hours, with the row names held in view, and keeps room for the handle and its ring at both ends. The way back to now keeps its place, so nothing moves when it comes and goes.",
      "category": "ui",
      "role": "interaction",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "timeline",
        "schedule",
        "day view",
        "shifts",
        "bookings",
        "gantt",
        "scrubber",
        "slider",
        "now line",
        "look ahead",
        "lanes",
        "sticky names",
        "horizontal scroll",
        "keyboard",
        "accessibility",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "a control room’s day: vehicles, crossings, deliveries or jobs per lane, with a look-ahead",
        "room, desk or equipment bookings for one day",
        "a shift plan or a production line’s schedule",
        "any live view where people need to ask “what will be happening at 15:30?”"
      ],
      "interaction": "Drag along the day to look at another time · Tab to the handle: arrows a step, Page Up and Down an hour, Home and End the day’s ends, N back to now · Narrow the window: it scrolls sideways, names held",
      "kits": [
        {
          "kit": "dashboard",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "chart-access",
          "why": "Its signs and table() for the text alternative of what the timeline shows"
        },
        {
          "id": "loading-states",
          "why": "A live feed behind it: notice: reserved keeps a dropped feed from moving the day"
        },
        {
          "id": "data-table",
          "why": "The timetable as a sortable table beside the drawing"
        },
        {
          "id": "tabs-tooltips",
          "why": "Today, tomorrow and the week as tabs over one timeline"
        }
      ],
      "variants": [],
      "version": "1.1.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "minHourWidth",
          "in": "module",
          "values": {
            "strict": 72,
            "refined": 56
          },
          "note": "Wider hours read calmer and roomier, and scroll sooner on a phone"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 1.5,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.622,
            "p99Ms": 18.1,
            "low1Fps": 53
          },
          "notes": "Measured with the clock running at five minutes a second and the handle looked ahead and back each second: every frame moves the clock’s line, the handle and the table under it; the rows and spans are built once and only placed by CSS fractions."
        }
      ],
      "signatures": [
        {
          "file": "day-timeline.ts",
          "declarations": "import { type Row, type Span } from './timeline-model';\nexport type DayTimelineOptions = {\n    start: number;\n    end: number;\n    rows: Row[];\n    spans: Span[];\n    now?: number | null;\n    step?: number;\n    bigStep?: number;\n    label?: string;\n    hint?: string;\n    format?: (t: number) => string;\n    valueText?: (t: number, looking: boolean) => string;\n    minHourWidth?: number;\n    describedBy?: string;\n    nowButton?: string | false;\n    reducedMotion?: boolean;\n    onLook?: (t: number | null) => void;\n};\nexport type DayTimeline = {\n    readonly element: HTMLElement;\n    readonly lookingAt: number | null;\n    readonly at: number;\n    set(next: Partial<Pick<DayTimelineOptions, 'rows' | 'spans' | 'now' | 'start' | 'end' | 'hint' | 'step' | 'bigStep' | 'minHourWidth'>>): void;\n    look(t: number | null): void;\n    focus(): void;\n    setReducedMotion(reduced: boolean): void;\n    dispose(): void;\n};\nexport declare function createDayTimeline(host: HTMLElement, options: DayTimelineOptions): DayTimeline;"
        },
        {
          "file": "timeline-model.ts",
          "declarations": "export type Span = {\n    id: string;\n    row: string;\n    start: number;\n    end: number;\n    label?: string;\n    tone?: 'accent' | 'ok' | 'warn' | 'bad' | 'muted';\n    hatched?: boolean;\n    planned?: number;\n};\nexport type Row = {\n    id: string;\n    label: string;\n    group?: string;\n};\nexport declare const clamp: (v: number, lo: number, hi: number) => number;\nexport declare const fraction: (t: number, start: number, end: number) => number;\nexport declare function timeAt(f: number, start: number, end: number, step?: number): number;\nexport declare function clock(t: number): string;\nexport declare function fromNow(t: number, now: number): string;\nexport type Tick = {\n    t: number;\n    label: string;\n    labelled: boolean;\n};\nexport declare function ticks(start: number, end: number, width: number, opts?: {\n    every?: number;\n    minGap?: number;\n    format?: (t: number) => string;\n}): Tick[];\nexport declare function keyStep(key: string, t: number, o: {\n    start: number;\n    end: number;\n    step: number;\n    bigStep: number;\n}): number | 'now' | null;\nexport declare const spansAt: (spans: readonly Span[], t: number) => Span[];\nexport declare function lanes(rows: readonly Row[]): Array<{\n    group: string | undefined;\n    from: number;\n    count: number;\n}>;\nexport declare const isNow: (t: number, now: number, step: number) => boolean;"
        }
      ],
      "pitfalls": [
        "Another agent’s showcase run reported empty aria-valuetext in Chrome’s accessibility tree",
        "A box that scrolls sideways clips up and down too",
        "The drawing is hidden from screen readers (its spans would be hundreds of unlabelled boxes)",
        "Times are plain numbers in one unit (minutes since midnight by default)",
        "A look the clock catches up with",
        "Keep `step` coarse enough to be useful (5 minutes for a day)",
        "Give a span its state in more than colour"
      ],
      "card": "entries/day-timeline.json"
    },
    {
      "id": "desire-paths",
      "aliases": [],
      "name": "Desire paths and meander",
      "summary": "The trail people would wear between two places, worked out from the land: A* over a height field with a cost for climbing that rises steeply toward the steepest grade allowed (so a steep face is climbed in switchbacks), for turning (so it runs in legs, not cell by cell) and for passing close to trees, rocks, walls and buildings; water deeper than a wade is never crossed, so it finds the ford. The cells are pulled straight and the corners cut, and it says how much room the land gives it along the way, which narrows or spreads its width. A seeded meander makes it wander as feet wore it; the same meander makes a stream wind, held still over a ford. Pure, deterministic and tested.",
      "category": "simulation",
      "role": "system",
      "stack": [
        "headless"
      ],
      "character": "calm",
      "tags": [
        "desire lines",
        "trails",
        "footpaths",
        "pathfinding",
        "a*",
        "terrain",
        "switchbacks",
        "slope",
        "obstacles",
        "meander",
        "streams",
        "value noise",
        "seeded",
        "deterministic",
        "canvas 2d",
        "no dependencies"
      ],
      "useCases": [
        "footpaths and animal tracks in an open-world or strategy map",
        "a level editor where a rough line settles onto the land",
        "paths across a park, campus or garden plan that people would really walk",
        "streams, tracks and lanes that wander instead of running ruler-straight",
        "hiking routes that zigzag up a hill rather than straight over it"
      ],
      "interaction": "Drag A and B (or tap to send B there) · arrow keys move B, Shift moves A",
      "kits": [],
      "pairsWith": [
        {
          "id": "heightfield-chunks",
          "why": "The land the paths are worked out over"
        },
        {
          "id": "road-network",
          "why": "Paved roads beside the worn trails"
        },
        {
          "id": "walk-grid",
          "why": "Walkers that follow the trails round props"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "canvas2d",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": null,
          "cpuMs": 0.08,
          "cpuP95Ms": 38.765,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 30.865,
            "p99Ms": 72.65,
            "low1Fps": 11.3
          },
          "notes": "Measured with the far end B circling the knoll: the trail is settled again (A* over about 15,000 cells, pulled straight, corners cut) every 0.4 s, then wandered and widened; the walkers move every frame. The frame time includes the Canvas 2D drawing."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.155,
          "cpuP95Ms": 0.385,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 31 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.1,
          "cpuP95Ms": 0.26,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 151 ms."
        }
      ],
      "signatures": [
        {
          "file": "desire.ts",
          "declarations": "export interface Point {\n    x: number;\n    z: number;\n}\nexport declare const dist: (a: Point, b: Point) => number;\nexport declare const ROOM_STEP = 4;\nexport type DesireObstacle = {\n    kind: 'circle';\n    x: number;\n    z: number;\n    r: number;\n} | {\n    kind: 'box';\n    x: number;\n    z: number;\n    halfX: number;\n    halfZ: number;\n    cos: number;\n    sin: number;\n} | {\n    kind: 'polygon';\n    points: readonly Point[];\n} | {\n    kind: 'segment';\n    ax: number;\n    az: number;\n    bx: number;\n    bz: number;\n    half: number;\n};\nexport interface DesireWorld {\n    heightAt(x: number, z: number): number;\n    obstacles: readonly DesireObstacle[];\n    waterAt?(x: number, z: number): number;\n}\nexport interface DesireOptions {\n    cell?: number;\n    margin?: number;\n    comfortable?: number;\n    maxGrade?: number;\n    clearance?: number;\n    ease?: number;\n    follow?: number;\n}\nexport interface SettledTrail {\n    points: Point[];\n    room: number[];\n    length: number;\n    steepest: number;\n    warnings: string[];\n}\nexport declare const DESIRE: {\n    readonly cell: 1.5;\n    readonly comfortable: number;\n    readonly maxGrade: 0.35;\n    readonly clearance: 1.1;\n    readonly ease: 2.5;\n    readonly steep: 10;\n    readonly near: 3;\n    readonly wade: 0.05;\n    readonly turn: 2;\n};\nexport declare function obstacleDistance(obstacle: DesireObstacle, x: number, z: number): number;\nexport interface Land {\n    x0: number;\n    z0: number;\n    cell: number;\n    nx: number;\n    nz: number;\n    height: Float32Array;\n    clear: Float32Array;\n    wet: Uint8Array;\n    line: Float32Array;\n}\nexport declare function settleTrail(rough: readonly Point[], world: DesireWorld, options?: DesireOptions): SettledTrail;\nexport declare const polylineLength: (points: readonly Point[]) => number;\nexport declare function resample(points: readonly Point[], step: number): Point[];\nexport declare function trailRoom(points: readonly Point[], world: DesireWorld, land?: Land, clearance?: number): number[];"
        },
        {
          "file": "meander.ts",
          "declarations": "import type { Point } from './desire';\nexport interface Sample extends Point {\n    theta: number;\n    s: number;\n}\nexport declare const MAX_WANDER = 3;\nexport declare const JUNCTION_HOLD = 12;\nexport declare function seedOfText(text: string): number;\nexport declare const nextSeed: (seed: number) => number;\nexport declare function meanderNoise(s: number, wavelength: number, seed: number): number;\nexport interface MeanderOptions {\n    amplitude: number;\n    wavelength: number;\n    seed: number;\n    holdStart?: number;\n    holdEnd?: number;\n    still?: ReadonlyArray<readonly [\n        number,\n        number\n    ]>;\n}\nexport interface Meander {\n    amplitude: number;\n    wavelength: number;\n    seed: number;\n    envelope(s: number): number;\n    offset(s: number): number;\n}\nexport declare function lineMeander(length: number, options: MeanderOptions): Meander | null;\nexport declare function sampleLine(points: readonly Point[], step?: number): Sample[];\nexport declare function meanderSamples(samples: readonly Sample[], meander: Meander | MeanderOptions | null): Sample[];"
        },
        {
          "file": "ribbon.ts",
          "declarations": "import type { Point } from './desire';\nimport { type MeanderOptions, type Sample } from './meander';\nimport { type TrailWidthOptions } from './trail-width';\nexport interface RibbonSample extends Sample {\n    width: number;\n    left: Point;\n    right: Point;\n}\nexport interface RibbonOptions {\n    step?: number;\n    meander?: MeanderOptions | null;\n    width?: TrailWidthOptions | null;\n    fixedWidth?: number;\n}\nexport declare function trailRibbon(points: readonly Point[], options?: RibbonOptions): RibbonSample[];"
        }
      ],
      "pitfalls": [
        "heightAt is asked for every grid cell and every check of a straight stretch",
        "Settling is A* over up to 90,000 cells times 17 ways in",
        "The ends are free even inside an obstacle’s clearance (a door, a gate)",
        "Water deeper than DESIRE.wade (5 cm) blocks the trail",
        "maxGrade is a hard limit",
        "The wander and width are drawn on top of the settled line",
        "Distances along the line (s) stay those of the line as settled, not of its wandering copy",
        "Coordinates are metres on the ground plane, x and z (y up)"
      ],
      "card": "entries/desire-paths.json"
    },
    {
      "id": "dot-globe",
      "aliases": [],
      "name": "Dot globe that unfolds into a map",
      "summary": "The world drawn with one primitive, the anti-aliased dot: about 258,000 dots on a sphere (land from hand-traced coastlines rasterised once into a mask, three nested lattices that re-screen like a printed halftone as the world shrinks), a globe that unfolds into an azimuthal map where distance from the centre is true, warps into a time map (distance by a per-dot value you supply), and lays flat as Equal Earth, every step a 0..1 input. Arcs for events in flight with a comet head and a landing ring follow every view; dotted rings mark distances or isochrones. Everything is placed in device pixels from DOM rects, so the GPU and your labels share one space (a CPU twin of the placement is included). Pipelines compiled ahead; drawn on demand.",
      "category": "data",
      "role": "hero-visual",
      "stack": [
        "webgpu"
      ],
      "character": "balanced",
      "tags": [
        "globe",
        "map",
        "dots",
        "halftone",
        "azimuthal equidistant",
        "equal earth",
        "time map",
        "isochrones",
        "arcs",
        "flows",
        "great circle",
        "cartogram",
        "raw webgpu",
        "wgsl",
        "dom + gpu",
        "draw on demand",
        "no dependencies"
      ],
      "useCases": [
        "a hero globe with live events",
        "travel time or reach from one place",
        "sites on a world map, labelled",
        "a story from globe to flat map",
        "any per-place value as distance"
      ],
      "interaction": "Drag or arrows to spin · scroll or +/− to unfold · click a city to centre on it",
      "kits": [
        {
          "kit": "dashboard",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "earth-globe",
          "why": "The realistic globe for the same story"
        },
        {
          "id": "chart-access",
          "why": "Each region’s numbers as a table"
        },
        {
          "id": "quiet-charts",
          "why": "The regional numbers as plain charts beside it"
        }
      ],
      "variants": [
        {
          "id": "earth-globe",
          "note": "Realistic: land and sea, an atmosphere, the sun’s glint, city lights at night and clouds, in TSL"
        }
      ],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 0.793,
          "cpuMs": 0.357,
          "cpuP95Ms": 0.82,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured exercising itself: the globe turns, three to four events a second fly, and it steps through globe, unfolded, time map and flat map every few seconds (258,000 dots, drawn every frame while anything moves)."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.524,
          "cpuMs": 0.725,
          "cpuP95Ms": 1.515,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.697,
            "p99Ms": 17.905,
            "low1Fps": 55.5
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 634 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 6.593,
          "cpuMs": 1.56,
          "cpuP95Ms": 3.26,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 211 ms."
        }
      ],
      "signatures": [
        {
          "file": "dot-field.ts",
          "declarations": "import { type ViewParams } from './project';\nimport type { DotWorld } from './lattice';\nexport type Rgba = [\n    number,\n    number,\n    number,\n    number\n];\nexport type Palette = {\n    ink: Rgba;\n    sea: Rgba;\n    accent: Rgba;\n};\nexport type WorldView = {\n    readonly params: ViewParams;\n    set(p: Partial<ViewParams>): void;\n};\nexport type Layer = {\n    what: 'world' | 'arcs' | 'rings';\n    view?: WorldView;\n    scissor?: [\n        number,\n        number,\n        number,\n        number\n    ];\n};\nexport type ArcSpec = {\n    from: [\n        number,\n        number\n    ];\n    to: [\n        number,\n        number\n    ];\n    start: number;\n    duration: number;\n    lift?: number;\n    values?: [\n        number,\n        number,\n        number,\n        number\n    ];\n};\nexport type DotField = {\n    readonly device: GPUDevice;\n    resize(dpr: number): {\n        width: number;\n        height: number;\n    };\n    setPalette(p: Partial<Palette>): void;\n    setWorld(world: DotWorld): void;\n    setValues(values: Float32Array, slot?: 0 | 1 | 'both'): void;\n    setMarker(index: number, emphasis: number): void;\n    view(init?: Partial<ViewParams>): WorldView;\n    arcs: {\n        spawn(arc: ArcSpec): void;\n        clear(): void;\n        inFlight(time: number): number;\n    };\n    rings: {\n        set(cx: number, cy: number, list: Array<[\n            number,\n            number,\n            number?\n        ]>, spacing?: number, dotR?: number): void;\n    };\n    draw(layers: Layer[], time: number): boolean;\n    gpuMs(): number | null;\n    readonly lost: boolean;\n    dispose(): void;\n};\nexport declare const MAX_ARCS = 128;\nexport type DotFieldOptions = {\n    device?: GPUDevice;\n    powerPreference?: GPUPowerPreference;\n};\nexport declare function createDotField(canvas: HTMLCanvasElement, options?: DotFieldOptions): Promise<DotField | null>;"
        },
        {
          "file": "land-mask.ts",
          "declarations": "import { type Ring } from './coastlines';\nexport declare const SEA = 0;\nexport declare const LAND_KIND = 1;\nexport declare const ICE = 2;\nexport type LandMask = {\n    width: number;\n    height: number;\n    cells: Uint8Array;\n    at(latDeg: number, lonDeg: number): number;\n};\nexport type MaskOptions = {\n    width?: number;\n    height?: number;\n    land?: Ring[];\n    water?: Ring[];\n    ice?: Ring[];\n    rowsPerSlice?: number;\n};\nexport declare function landMaskSlices(options?: MaskOptions): Generator<number, LandMask, void>;\nexport declare function landMask(options?: MaskOptions): LandMask;"
        },
        {
          "file": "lattice.ts",
          "declarations": "import { type LandMask } from './land-mask';\nexport declare const MARKER = 3;\nexport type Marker = {\n    lat: number;\n    lon: number;\n    emphasis?: number;\n};\nexport type DotWorld = {\n    dots: Float32Array<ArrayBuffer>;\n    count: number;\n    markerBase: number;\n    land: number;\n    stepDeg: number;\n};\nexport declare const ringCount: (latDeg: number, stepDeg: number) => number;\nexport declare function latticeSize(stepDeg: number): number;\nexport declare function latticeSlices(mask: LandMask, { stepDeg, markers, ringsPerSlice }?: {\n    stepDeg?: number | undefined;\n    markers?: Marker[] | undefined;\n    ringsPerSlice?: number | undefined;\n}): Generator<number, DotWorld, void>;\nexport declare function buildLattice(mask: LandMask, options?: {\n    stepDeg?: number;\n    markers?: Marker[];\n}): DotWorld;\nexport declare function valuesFor(world: DotWorld, value: (latDeg: number, lonDeg: number, kind: number, index: number) => number, { sea }?: {\n    sea?: boolean | undefined;\n}): Float32Array;\nexport declare function angleBetween(lat1: number, lon1: number, lat2: number, lon2: number): number;\nexport declare const kmBetween: (lat1: number, lon1: number, lat2: number, lon2: number) => number;\nexport declare const arcLift: (angleDeg: number) => number;"
        },
        {
          "file": "project.ts",
          "declarations": "export type ViewParams = {\n    cx: number;\n    cy: number;\n    R: number;\n    Raz: number;\n    lat0: number;\n    lon0: number;\n    unfold: number;\n    warp: number;\n    flat: number;\n    vMax: number;\n    valueMix: number;\n    stagger: number;\n    dotR: number;\n    lodStep: number;\n    minR: number;\n    maxR: number;\n    compression: number;\n    markerR: number;\n    flatCx: number;\n    flatCy: number;\n    flatScale: number;\n    flatLon0: number;\n    arcAlpha: number;\n    seaFade: number;\n};\nexport declare const DEFAULT_VIEW: ViewParams;\nexport type Vec3 = [\n    number,\n    number,\n    number\n];\nexport declare const smoothstep: (a: number, b: number, x: number) => number;\nexport declare function unitVector(lat: number, lon: number): Vec3;\nexport declare function toView(p: Vec3, lat0: number, lon0: number): Vec3;\nexport declare function equalEarth(lat: number, lon: number): [\n    number,\n    number\n];\nexport declare const EQUAL_EARTH_EXTENT: [\n    number,\n    number\n];\nexport declare function fitEqualEarth(width: number, height: number, fill?: number): number;\nexport declare const wrapAngle: (l: number) => number;\nexport declare function staggered(x: number, s: number, S: number): number;\nexport type Placed = {\n    x: number;\n    y: number;\n    alpha: number;\n    front: number;\n    s: number;\n    pu: number;\n    pf: number;\n    scale: number;\n    shade: number;\n};\nexport declare function placeDot(p: ViewParams, latDeg: number, lonDeg: number, value?: number): Placed;\nexport declare const kmRadius: (km: number, Raz: number) => number;\nexport declare const valueRadius: (value: number, vMax: number, Raz: number) => number;\nexport declare function hexRgba(hex: string, alpha?: number): [\n    number,\n    number,\n    number,\n    number\n];"
        }
      ],
      "pitfalls": [
        "Everything is in the canvas’s device pixels",
        "The canvas is transparent (premultiplied alpha)",
        "placeDot (project.ts) is the shader’s place() on the CPU",
        "The time map needs a value for every dot that should move",
        "Values are distances from the view’s centre",
        "A value far above vMax lands outside the rim",
        "draw() skips (returns false) while the last frame is still on the GPU",
        "Arcs crossing the flat map’s seam, or passing near the unfolded map’s rim",
        "A finer lattice is more dots, not more detail",
        "Without WebGPU createDotField resolves null. drawDotStill draws a still of the same dots on a…"
      ],
      "card": "entries/dot-globe.json"
    },
    {
      "id": "drag-reorder",
      "aliases": [],
      "name": "Drag to reorder lists",
      "summary": "Reorder a list, move cards between the columns of a board, or rearrange a grid: by mouse, by touch (a long press lifts, so the list still scrolls) and by keyboard (Space lifts, the arrows move, Space drops, Escape puts it back). A gap shows where it lands, the others slide out of the way, edges scroll, and every step is announced. Restyle it through its states, on your own items.",
      "category": "ui",
      "role": "interaction",
      "stack": [
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "drag and drop",
        "sortable",
        "reorder",
        "kanban",
        "grid",
        "flip",
        "touch",
        "long press",
        "keyboard",
        "auto-scroll",
        "live region",
        "accessibility",
        "rtl",
        "dom",
        "css",
        "no dependencies"
      ],
      "useCases": [
        "to-do lists and playlists",
        "kanban boards",
        "photo and card grids",
        "settings that set a priority order",
        "menus and tabs people arrange themselves"
      ],
      "interaction": "Drag an item (on touch, hold it first) · or focus one and press Space, then the arrows · switch examples at the top",
      "kits": [
        {
          "kit": "foundations",
          "as": "optional"
        },
        {
          "kit": "shop",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "card-springs",
          "why": "Cards that lift and lean while dragged"
        },
        {
          "id": "labelled-undo",
          "why": "Undo a move by name"
        },
        {
          "id": "swipe-actions",
          "why": "Swipe rows of the same list for actions"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "reducedMotion",
          "in": "module",
          "values": {
            "strict": true
          },
          "note": "the still version: no glide, no nudge"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0.175,
          "cpuP95Ms": 1.05,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the demo dragging by itself: synthetic pointer events lift an item, carry it over 40 frames to another place and drop it, then rest 20 frames, going round the to-do list, the board (across its columns) and the card grid. Each frame moves the copy, finds the gap’s place and, when it changes, slides the others (FLIP). Nothing runs between drags."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.23,
          "cpuP95Ms": 1.19,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 57 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.3,
          "cpuP95Ms": 2.38,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 51 ms."
        }
      ],
      "signatures": [
        {
          "file": "drag-reorder.ts",
          "declarations": "import { type Layout, type Messages } from './reorder-model';\nexport type ReorderPlace = {\n    list: Reorder;\n    index: number;\n};\nexport type ReorderEvent = {\n    item: HTMLElement;\n    from: ReorderPlace;\n    to: ReorderPlace;\n    via: 'pointer' | 'keyboard';\n};\nexport type ReorderOptions = {\n    items?: string;\n    handle?: string;\n    layout?: Layout;\n    group?: string;\n    name?: string;\n    label?: (item: HTMLElement) => string;\n    accepts?: (item: HTMLElement, from: Reorder) => boolean;\n    onReorder?: (e: ReorderEvent) => void;\n    onSay?: (text: string) => void;\n    ignore?: string;\n    threshold?: number;\n    longPress?: number;\n    duration?: number;\n    reducedMotion?: boolean;\n    autoScroll?: boolean;\n    edge?: number;\n    speed?: number;\n    moveDom?: boolean;\n    layer?: HTMLElement;\n    roving?: boolean;\n    disabled?: boolean;\n    messages?: Partial<Messages>;\n    animate?: (ghost: HTMLElement, phase: 'land', to: {\n        x: number;\n        y: number;\n    }) => Promise<unknown> | void;\n};\nexport type Reorder = {\n    readonly element: HTMLElement;\n    readonly options: ReorderOptions;\n    items(): HTMLElement[];\n    refresh(): void;\n    move(from: number, to: number, into?: Reorder): boolean;\n    cancel(): void;\n    readonly dragging: boolean;\n    destroy(): void;\n};\nexport declare function flip(elements: Iterable<HTMLElement>, mutate: () => void, options?: {\n    duration?: number;\n    reducedMotion?: boolean;\n    measured?: () => void;\n}): void;\nexport declare function reorderable(container: HTMLElement, options?: ReorderOptions): Reorder;"
        },
        {
          "file": "reorder-model.ts",
          "declarations": "export type Box = {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n};\nexport type Point = {\n    x: number;\n    y: number;\n};\nexport type Layout = 'y' | 'x' | 'grid';\nexport declare function moveItem<T>(list: readonly T[], from: number, to: number): T[];\nexport declare function transferItem<T>(source: readonly T[], target: readonly T[], from: number, to: number): [\n    T[],\n    T[]\n];\nexport declare function dropIndex(boxes: readonly Box[], current: number, point: Point, layout: Layout, reverse?: boolean): number;\nexport declare function columnsOf(boxes: readonly Box[]): number;\nexport type KeyMove = {\n    index: number;\n} | {\n    list: -1 | 1;\n} | null;\nexport declare function keyMove(key: string, index: number, count: number, layout: Layout, columns?: number, rtl?: boolean): KeyMove;\nexport declare function edgeSpeed(at: number, start: number, end: number, band?: number, max?: number): number;\nexport type Said = {\n    label: string;\n    position: number;\n    total: number;\n    list: string;\n    listChanged: boolean;\n};\nexport type Messages = {\n    instructions: string;\n    lifted(s: Said): string;\n    moved(s: Said): string;\n    dropped(s: Said): string;\n    cancelled(s: Said): string;\n};\nexport declare const DEFAULT_MESSAGES: Messages;"
        }
      ],
      "pitfalls": [
        "Import drag-reorder.base.css, then drag-reorder.css (or your own look instead)",
        "The copy under the pointer is position",
        "Every list gets a non-passive touchmove listener, so a lifted finger can stop the page scrolling",
        "Items are found among the container’s direct children",
        "With moveDom: false (React, Vue, Svelte) the DOM is put back before onReorder",
        "Checkboxes, links, buttons and fields inside an item never start a drag (the ignore selector)",
        "Pointer drags announce only the lift, the drop and a cancel",
        "A lifted keyboard item that loses focus (Tab, a click elsewhere) is put back"
      ],
      "card": "entries/drag-reorder.json"
    },
    {
      "id": "dynamic-resolution",
      "aliases": [],
      "name": "Dynamic resolution on GPU timestamps",
      "summary": "Holds a frame budget on a heavy view by drawing the scene at fewer pixels only while it needs to, instead of lowering quality for everyone. Once a second it sets the GPU’s own frame times (WebGPU timestamp queries, not the CPU’s guess) against the budget: when the 80th percentile runs over 0.9 of it the render scale steps down a notch (two past 1.25), and after three seconds under 0.62 it climbs back, between 1× and 0.67× by default (0.6 or 0.5 on weaker tiers), resting two seconds after each change. three draws into a smaller frame buffer, and the copy to the canvas brings it back up with a Catmull-Rom bicubic and contrast-adaptive sharpening, so HUD and DOM over the canvas stay crisp. Its own cost is small: one timestamp read-back a frame, a few lines of CPU once a second, and nine texture reads a screen pixel in the copy three makes anyway; the measured 8.8 ms GPU is the demo’s heavy wood held under an 11.1 ms budget. Only pixel work scales (not shadows, vertices or draw calls), and it needs the timestamp-query feature (Chrome and Edge) and three r187’s internals. Use it in games and heavy WebGPU scenes that must hold 60 fps on laptops and weaker GPUs, as a self-tuning quality setting, or with the frame cap for battery.",
      "category": "systems",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "calm",
      "tags": [
        "dynamic resolution",
        "render scale",
        "timestamp queries",
        "frame budget",
        "upscaling",
        "sharpening",
        "three internals",
        "webgpu"
      ],
      "useCases": [
        "games that must hold 60 fps on weak GPUs",
        "heavy scenes on laptops at 150 % scaling",
        "dense foliage and particle-heavy views",
        "a quality setting that tunes itself",
        "frame caps for battery"
      ],
      "interaction": "Raise the GPU load and watch the scale step down to hold the budget · drag to orbit",
      "kits": [
        {
          "kit": "game",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "capability-tiers",
          "why": "Starts from the tier it picked"
        },
        {
          "id": "post-stack",
          "why": "Scales the post passes with the picture"
        },
        {
          "id": "perf-gates",
          "why": "Fails the build when the budget breaks"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "The load at two fifths of the work; the scale may go down to 0.6.",
          "low": "The load at a tenth of the work; the scale may go down to 0.5."
        },
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.80",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-03",
          "gpuMs": 8.839,
          "cpuMs": 0.52,
          "cpuP95Ms": 0.93,
          "badge": "heavy",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured at a held heavy load (65 %, about 15 ms a frame at full scale on the reference machine) with dynamic resolution on and an 11.1 ms budget: the GPU time is what the controller holds the wood to (it steps the scale down until the frames fit, or reaches its least), not the wood at full resolution."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 59.376,
          "cpuMs": 1.087,
          "cpuP95Ms": 1.75,
          "badge": "heavy",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 599 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 18.928,
          "cpuMs": 1.26,
          "cpuP95Ms": 2.18,
          "badge": "heavy",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 328 ms."
        }
      ],
      "signatures": [
        {
          "file": "dynamic-scale.ts",
          "declarations": "export declare const DYNAMIC: {\n    readonly scales: readonly [\n        1,\n        0.92,\n        0.85,\n        0.78,\n        0.72,\n        0.67\n    ];\n    readonly high: 0.9;\n    readonly drop: 1.25;\n    readonly low: 0.62;\n    readonly climb: 3;\n    readonly cooldown: 2;\n    readonly frames: 20;\n    readonly few: 3;\n};\nexport declare const DYNAMIC_LEAST: 1 | 0.85 | 0.72 | 0.92 | 0.78 | 0.67;\nexport type DynamicScaleOptions = {\n    least?: number;\n    scales?: readonly number[];\n};\nexport declare class DynamicScale {\n    scale: number;\n    constructor(top?: number, options?: DynamicScaleOptions);\n    setTop(top: number): void;\n    setLeast(least: number): void;\n    step(times: readonly number[], budget: number): number;\n}"
        },
        {
          "file": "frame-cap.ts",
          "declarations": "export declare function capFrame(time: number, due: number, interval: number): {\n    draw: boolean;\n    due: number;\n};"
        },
        {
          "file": "hold-frame-rate.ts",
          "declarations": "import type * as THREE from 'three/webgpu';\nimport { DynamicScale, type DynamicScaleOptions } from './dynamic-scale';\nimport { GpuTimer } from './gpu-timer';\nexport type HoldTier = 'high' | 'medium' | 'low';\nexport declare const HOLD_TIER_LEAST: Record<HoldTier, number>;\nexport type HoldFrameRateOptions = DynamicScaleOptions & {\n    tier?: HoldTier;\n    budget?: number;\n    top?: number;\n    timer?: GpuTimer;\n};\nexport declare class HoldFrameRate {\n    readonly timer: GpuTimer;\n    readonly dynamic: DynamicScale;\n    budget: number;\n    onChange: ((scale: number) => void) | null;\n    constructor(renderer: THREE.WebGPURenderer, options?: HoldFrameRateOptions);\n    get supported(): boolean;\n    get scale(): number;\n    get on(): boolean;\n    set on(value: boolean);\n    setTop(top: number): void;\n    setLeast(least: number): void;\n    afterFrame(): void;\n    dispose(): void;\n}"
        },
        {
          "file": "render-scale.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\nexport declare const RENDER_SCALES: readonly [\n    1,\n    0.85,\n    0.75,\n    0.67,\n    0.5\n];\nexport declare const DEFAULT_RENDER_SCALE = 1;\nexport declare const SHARPEN: {\n    readonly min: 0;\n    readonly max: 1;\n    readonly recommended: 0.5;\n};\nexport declare function setRenderScale(renderer: THREE.WebGPURenderer, scale: number): void;\nexport declare function renderScaleOf(renderer: THREE.Renderer): number;\nexport declare function frameSize(renderer: THREE.Renderer, out: THREE.Vector2): THREE.Vector2;\ntype V4 = Node<'vec4'>;\ntype F = Node<'float'>;\nexport declare function upscaleSample(frame: THREE.Texture, sharpen: F): V4;\nexport declare function upscaleToCanvas(renderer: THREE.WebGPURenderer, sharpen?: number): {\n    sharpen: THREE.UniformNode<\"float\", number>;\n    dispose(): void;\n};\nexport {};"
        }
      ],
      "pitfalls": [
        "A weak GPU can sit at the least scale and still run over",
        "Only pixel work scales",
        "Each new scale makes three’s frame buffer again (a short hitch, no shader build)",
        "A check wants 20 frames a second",
        "Measure uncapped when tuning",
        "three keeps one timestamp query set a kind for the whole renderer, and any read-back empties it",
        "On Safari with an Apple GPU the frame’s passes overlap",
        "Timestamp queries need the timestamp-query feature",
        "Chrome rounds timestamps to 0.1 ms",
        "It reaches into three r187 internals",
        "There must be a frame buffer to scale",
        "Hook upscaleToCanvas before the first frame",
        "Screen-space nodes (screenUV, viewportSharedTexture) follow the frame buffer"
      ],
      "card": "entries/dynamic-resolution.json"
    },
    {
      "id": "earth-globe",
      "aliases": [],
      "name": "Realistic Earth with flows",
      "summary": "A planet to put a story on: land and sea from Natural Earth, the sun rising over the edge through an atmosphere, its glint on the water, city lights on the night side, clouds and stars. Any country lights up on its own (warm land inside a fine outline, its lights on while the rest dim), from one country channel in the map, any number at once. Flows between places are great-circle arcs exactly as wide on screen at any distance, carrying comets with tails and a ring where each lands. Sharp tiers baked for chosen places carry relief and a coast that is the zero line of the ground’s height, so it stays a fine line however close the camera comes. The maps are baked once into small files (about 2.7 MB) by a dependency-free Node tool; three r187 TSL, drawn on demand.",
      "category": "simulation",
      "role": "hero-visual",
      "stack": [
        "three",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "globe",
        "earth",
        "planet",
        "atmosphere",
        "night lights",
        "flows",
        "arcs",
        "comets",
        "great circle",
        "constant screen width",
        "relief",
        "coastline",
        "natural earth",
        "etopo",
        "tsl",
        "webgpu",
        "draw on demand",
        "no dependencies"
      ],
      "useCases": [
        "a hero globe for a product or a talk",
        "flows between places (trade, travel, messages)",
        "highlighting countries on a world view",
        "flying from the whole planet to one coast",
        "a sunrise over the edge for a title"
      ],
      "interaction": "Drag to turn · scroll or pinch to zoom · click a country to light it · arrows, +/−, Enter",
      "kits": [],
      "pairsWith": [
        {
          "id": "dot-globe",
          "why": "The stylised globe for the same story"
        },
        {
          "id": "camera-director",
          "why": "Fly between places as shots"
        },
        {
          "id": "world-pinned-labels",
          "why": "City and route labels that follow the turning globe"
        }
      ],
      "variants": [
        {
          "id": "dot-globe",
          "note": "Stylised: the world in halftone dots, unfolding into a map, in raw WebGPU"
        }
      ],
      "version": "1.0.2",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-13",
          "gpuMs": 0.644,
          "cpuMs": 0.19,
          "cpuP95Ms": 0.275,
          "badge": "moderate",
          "drawCalls": 10,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured turning by itself at the globe’s resting distance, the sun on the edge, seven flows with two comets each, clouds and stars on: drawn every frame. The coast tier is loaded and blended in the same shader, off screen. Left alone for 30 s (and not measured) it rests: nothing is drawn."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 3.539,
          "cpuMs": 0.585,
          "cpuP95Ms": 0.79,
          "badge": "heavy",
          "drawCalls": 10,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 1461 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 3.205,
          "cpuMs": 0.24,
          "cpuP95Ms": 0.38,
          "badge": "heavy",
          "drawCalls": 10,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 1097 ms."
        }
      ],
      "signatures": [
        {
          "file": "earth.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { EarthMaps } from './maps';\nexport interface EarthLook {\n    day: number;\n    sunAt: number;\n    sunSide: number;\n    sun: number;\n    lights: number;\n    others: number;\n    glow: number;\n    coast: number;\n    ground: number;\n    clouds: number;\n    air: number;\n    stars: number;\n}\nexport declare const defaultLook: () => EarthLook;\nexport interface EarthOptions {\n    maps: EarthMaps;\n    radius?: number;\n    sky?: number;\n}\nexport interface Earth {\n    readonly group: THREE.Group;\n    readonly radius: number;\n    readonly look: EarthLook;\n    set(look: Partial<EarthLook>): void;\n    light(index: number, level?: number): void;\n    readonly lit: ReadonlyMap<number, number>;\n    frame(camera: THREE.Camera, time: number, dt: number): boolean;\n    dispose(): void;\n}\nexport declare function createEarth(o: EarthOptions): Earth;"
        },
        {
          "file": "flows.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nexport interface FlowSpec {\n    from: [\n        number,\n        number\n    ];\n    to: [\n        number,\n        number\n    ];\n    colour?: [\n        number,\n        number,\n        number\n    ];\n    strength?: number;\n    comets?: number;\n    seconds?: number;\n    width?: number;\n}\nexport interface Flows {\n    readonly group: THREE.Group;\n    add(spec: FlowSpec, opts?: {\n        grow?: number;\n    }): number;\n    remove(id: number): void;\n    clear(): void;\n    readonly count: number;\n    frame(time: number, dt: number, width: number, height: number, dpr: number): boolean;\n    dispose(): void;\n}\nexport declare function createFlows(o?: {\n    radius?: number;\n    capacity?: number;\n}): Flows;"
        },
        {
          "file": "geo.ts",
          "declarations": "export type V3 = [\n    number,\n    number,\n    number\n];\nexport type Box = [\n    number,\n    number,\n    number,\n    number\n];\nexport declare function latLonDir(lat: number, lon: number): V3;\nexport declare function dirLatLon(d: V3): [\n    number,\n    number\n];\nexport declare function angleBetween(a: [\n    number,\n    number\n], b: [\n    number,\n    number\n]): number;\nexport declare const arcLift: (angle: number) => number;\nexport declare function arcPoint(a: V3, b: V3, s: number, lift: number, R?: number): V3;\nexport declare function raySphere(o: V3, d: V3, R?: number): V3 | null;\nexport declare function sunFor(cam: V3, camUp: V3, R: number, at: number, side: number): {\n    dir: V3;\n    visible: number;\n};\nexport declare const boxRadians: (b: Box) => Box;\nexport declare const boxCentre: (b: Box) => [\n    number,\n    number\n];\nexport declare function mapPixel(lat: number, lon: number, width: number, height: number): [\n    number,\n    number\n];\nexport declare function viewOf(lat: number, lon: number, range: number, tilt: number, R?: number): {\n    position: V3;\n    target: V3;\n    up: V3;\n};"
        },
        {
          "file": "maps.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { type Box } from './geo';\nexport interface EarthData {\n    map: {\n        image: string;\n        width: number;\n        height: number;\n    };\n    countries: {\n        name: string;\n        id: string;\n    }[];\n    tiers?: {\n        name: string;\n        image: string;\n        box: Box;\n        range: number;\n        width: number;\n        height: number;\n    }[];\n}\nexport interface EarthTier {\n    name: string;\n    texture: THREE.Texture;\n    box: Box;\n    range: number;\n}\nexport interface EarthMaps {\n    map: THREE.Texture;\n    width: number;\n    height: number;\n    tiers: EarthTier[];\n    countries: EarthData['countries'];\n    countryAt(lat: number, lon: number): number;\n    dispose(): void;\n}\nexport interface LoadOptions {\n    data: EarthData;\n    urls: Record<string, string>;\n    maxWidth?: number;\n    tiers?: string[];\n    signal?: AbortSignal;\n}\nexport declare function loadEarthMaps(o: LoadOptions): Promise<EarthMaps>;"
        }
      ],
      "pitfalls": [
        "The country channel (blue) must never be filtered",
        "Draw a lit country’s outline as a contour of a soft field",
        "Decode the maps with createImageBitmap",
        "The maps are data: re-encode them only losslessly",
        "The coast is a contour, not a stroke",
        "Flows are as wide on screen at any distance only because each segment is extruded in clip space",
        "A great circle between antipodes is undefined",
        "The comets’ positions come from the clock you pass to flows.frame",
        "The sun is placed for each camera (just behind or over the edge as that camera sees it)",
        "Close to the ground the camera is inside the air’s shell",
        "Ice goes by latitude, not by the map",
        "Heads and beacons are hidden by a ray test against the sphere, not the depth buffer",
        "Close to the ground, move the camera’s near plane with its height (the demo uses 0.3 × altitude)",
        "A tier must stay within the map’s land",
        "The map is 4096 × 2048 (about 45 MB with mips on the GPU)",
        "Global relief needs a global height grid"
      ],
      "card": "entries/earth-globe.json"
    },
    {
      "id": "effects-switchboard",
      "aliases": [],
      "name": "Effects switchboard",
      "summary": "One place that says which of an app’s effects are on: groups such as hover, links, ambient, motion and sound, each switchable and remembered, E to turn everything off and back on, a small side tab with real switches, and reduced motion feeding the same Motion switch. A knob table tunes them: rotary dials (or slider rows) built from rows of data, each with its recommended value marked, a number box, Reset, keys and drag, remembered, and dimmed while its group is off.",
      "category": "ui",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "dom",
        "settings",
        "accessibility",
        "reduced motion",
        "localStorage",
        "shadow dom",
        "keyboard",
        "knobs",
        "dials",
        "sliders",
        "rotary",
        "tuning",
        "parameters",
        "no dependencies"
      ],
      "useCases": [
        "apps with ambient or decorative effects",
        "design reviews (see a look with and without its effects)",
        "motion and sound preferences",
        "calm modes",
        "kiosks and demos",
        "a tuning panel for an effect’s parameters",
        "settings with recommended values and a reset"
      ],
      "interaction": "Hover the cards, press Ping, open the FX tab on the right or press E · turn the dials under Tune (drag, arrows, or type), double-click one to reset it",
      "kits": [
        {
          "kit": "foundations",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "appearance-theme",
          "why": "Motion and theme settings side by side"
        },
        {
          "id": "ui-sounds",
          "why": "The sound group it switches"
        },
        {
          "id": "capability-tiers",
          "why": "Effects off by default on weak devices"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.80",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-03",
          "gpuMs": null,
          "cpuMs": 0.04,
          "cpuP95Ms": 0.07,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with every group at its default (sound off): the per-frame cost is the ambient drift moving three blurred layers and the counters easing. The switchboard itself does nothing per frame; it only acts when a switch changes."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.055,
          "cpuP95Ms": 0.11,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 41 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.08,
          "cpuP95Ms": 0.12,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 50 ms."
        }
      ],
      "signatures": [
        {
          "file": "effect-panel.ts",
          "declarations": "import type { EffectSwitches } from './effect-switches';\nexport type EffectPanelOptions = {\n    target?: HTMLElement;\n    position?: 'fixed' | 'absolute';\n    title?: string;\n    tabLabel?: string;\n    note?: string;\n};\nexport type EffectPanel = {\n    open(): void;\n    close(focusTab?: boolean): void;\n    toggle(): void;\n    readonly isOpen: boolean;\n    readonly host: HTMLElement;\n    destroy(): void;\n};\nexport declare function mountEffectPanel(switches: EffectSwitches, options?: EffectPanelOptions): EffectPanel;"
        },
        {
          "file": "effect-switches.ts",
          "declarations": "export type EffectGroup = {\n    id: string;\n    label: string;\n    hint?: string;\n    default?: boolean;\n};\nexport type MotionQuery = {\n    readonly matches: boolean;\n    addEventListener(type: 'change', fn: () => void): void;\n    removeEventListener(type: 'change', fn: () => void): void;\n};\nexport type EffectSwitchesOptions = {\n    groups: EffectGroup[];\n    storageKey?: string | null;\n    motionGroup?: string | null;\n    motionQuery?: MotionQuery | null;\n    hotkey?: string | null;\n    keyTarget?: EventTarget | null;\n};\nexport type EffectSwitches = {\n    readonly groups: readonly EffectGroup[];\n    readonly motionGroup: string | null;\n    on(group?: string | null): boolean;\n    set(group: string, on: boolean): void;\n    toggle(group: string): void;\n    setAll(on: boolean): void;\n    allOff(): boolean;\n    toggleAll(): void;\n    chosen(group: string): boolean;\n    reset(): void;\n    reducedMotion(): boolean;\n    states(): Record<string, boolean>;\n    subscribe(fn: (group: string, on: boolean) => void): () => void;\n    dispose(): void;\n};\nexport declare function createEffectSwitches(options: EffectSwitchesOptions): EffectSwitches;\nexport declare function reflectEffects(switches: EffectSwitches, el: Element, attribute?: string): () => void;"
        },
        {
          "file": "knob-table.ts",
          "declarations": "import { type Knob, type KnobValue, type KnobValues } from './knob-model';\nexport type { Knob, KnobValue, KnobValues, NumberKnob, ToggleKnob } from './knob-model';\nexport type KnobSection = {\n    title: string;\n    knobs: Knob[];\n};\nexport type KnobTableOptions = {\n    knobs: Knob[] | KnobSection[];\n    values?: Partial<KnobValues>;\n    storageKey?: string | null;\n    look?: 'dials' | 'rows';\n    title?: string;\n    onChange?: (id: string, value: KnobValue, all: KnobValues) => void;\n};\nexport type KnobTable = {\n    readonly element: HTMLElement;\n    values(): KnobValues;\n    get(id: string): KnobValue | undefined;\n    set(id: string, value: KnobValue, options?: {\n        silent?: boolean;\n    }): void;\n    reset(id?: string): void;\n    mute(id: string, muted: boolean, note?: string): void;\n    destroy(): void;\n};\nexport declare function createKnobTable(mount: HTMLElement, options: KnobTableOptions): KnobTable;"
        }
      ],
      "pitfalls": [
        "The switchboard only says what is on",
        "Gate what someone asked for differently from decoration",
        "Turning Links off should leave links recognisable (a plain underline), not remove them",
        "Reduced motion sets Motion’s default only",
        "Browsers only let audio start after a gesture",
        "The E hotkey listens on the window and skips inputs, text areas and contenteditable",
        "Import knob-table.base.css, then knob-table.css (or your own look)",
        "A dial takes its drags (touch-action: none) and turns with a drag up or right, not round",
        "Saved values are cleaned against the table on load",
        "onChange runs for every change the person makes, not for `set(…, { silent: true })`"
      ],
      "card": "entries/effects-switchboard.json"
    },
    {
      "id": "exact-zoom-sheet",
      "aliases": [],
      "name": "A sheet that adds up at any zoom",
      "summary": "One zoomable sheet of rows × days, from three years of a whole organisation down to the records of one hour, where every pixel shows the true total of what it covers. The shader reads integer summed-area tables (four texel loads for any box, unsigned arithmetic that wraps back to the exact answer); text is glyphs rasterised at native size and drawn 1:1; the camera flies on van Wijk and Nuij’s smooth zoom paths; levels of detail, a ruler that slides between calendar levels, row groups, margin charts on the sheet’s own axes, an overview, findings detected from expected against actual, and an audit that every level adds up to the cent. A DOM and SVG fallback without WebGPU. For the spreadsheet export, formulas and merged headings follow when a column is inserted, deleted or moved (`$` anchors, ranges, `{row}`, `#REF!`).",
      "category": "data",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "summed-area table",
        "prefix sums",
        "zoomable",
        "heatmap",
        "calendar",
        "level of detail",
        "semantic zoom",
        "smooth zoom",
        "van wijk nuij",
        "glyph atlas",
        "anomaly detection",
        "audit",
        "exact",
        "raw webgpu",
        "wgsl",
        "dom + gpu",
        "keyboard",
        "fallback",
        "formulas",
        "spreadsheet",
        "#REF!",
        "merged cells",
        "column remap"
      ],
      "useCases": [
        "sales or usage by place and day",
        "drill-down from years to single records",
        "figures that must agree to the cent",
        "incidents found in many time series",
        "a rows × days grid too big for a DOM table",
        "a spreadsheet template whose columns people rearrange"
      ],
      "interaction": "Wheel or pinch to zoom · drag to pan · click pins, a second pin compares · double-click dives · a finding flies there · arrows, + − and Enter on the sheet · G edits the export’s columns",
      "kits": [
        {
          "kit": "dashboard",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "data-table",
          "why": "The records behind the cell you zoom into"
        },
        {
          "id": "date-picker",
          "why": "Jump to a range of days"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "calm",
          "in": "module",
          "values": {
            "strict": true
          },
          "note": "cross-fades instead of flights and eased zooms"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-10",
          "gpuMs": 0.122,
          "cpuMs": 0.005,
          "cpuP95Ms": 0.01,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured flying from finding to finding (a flight every 2.4 s, through every altitude down to hours), 240 shops × 1,096 days in view at the top: the sheet shader reads the prefix sums for every pixel, plus the text and mark layers."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.524,
          "cpuMs": 0,
          "cpuP95Ms": 0.005,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.605,
            "p99Ms": 24.79,
            "low1Fps": 36.3
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 821 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 6.987,
          "cpuMs": 0,
          "cpuP95Ms": 0.02,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 720 ms."
        }
      ],
      "signatures": [
        {
          "file": "calendar.ts",
          "declarations": "export type Level = {\n    id: 'year' | 'quarter' | 'month' | 'week' | 'day' | 'hour';\n    name: string;\n    bounds: Int32Array | null;\n    index: Uint16Array | null;\n    count: number;\n    mean: number;\n};\nexport type Axis = {\n    cols: number;\n    per: number;\n    levels: Level[];\n    day: number;\n    hour: number;\n    year: Uint16Array;\n    month: Uint8Array;\n    date: Uint8Array;\n    weekday: Uint8Array;\n    cellAt(level: number, t: number): [\n        number,\n        number\n    ];\n    eachCell(level: number, t0: number, t1: number, fn: (c0: number, c1: number, i: number) => void): void;\n    labels(level: number, start: number): string[];\n    words(t0: number, t1: number): string;\n    short(t0: number, t1: number): string;\n    sameDate(c: number): number[];\n    parse(p: string): [\n        number,\n        number\n    ] | null;\n    dayOf(y: number, m0: number, d: number): number;\n};\nexport declare const MON: string[];\nexport declare const MONTH_FULL: string[];\nexport declare const WDN: string[];\nexport declare const hourLabel: (h: number) => string;\nexport declare function calendarAxis(start: string, cols: number, per?: number): Axis;"
        },
        {
          "file": "colour.ts",
          "declarations": "export type SheetTheme = {\n    name: string;\n    paper: string;\n    paper2: string;\n    wash: string;\n    ink: string;\n    ink2: string;\n    ink3: string;\n    rule: string;\n    rule2: string;\n    mark: string;\n    markInk: string;\n    seq: string[];\n    div: string[];\n};\nexport declare const PAPER: SheetTheme;\nexport declare const INK: SheetTheme;\nexport type RGB = [\n    number,\n    number,\n    number\n];\nexport declare function hex(h: string): RGB;\nexport declare function toLab([r, g, b]: RGB): RGB;\nexport declare function fromLab([L, a, b]: RGB): RGB;\nexport declare function buildRamp(stops: string[]): RGB[];\nexport declare const rampAt: (ramp: RGB[], n: number) => RGB;\nexport declare const rampCss: (ramp: RGB[], gamma?: number, steps?: number) => string;\nexport declare const luminance: (c: RGB) => number;\nexport declare function contrast(a: string, b: string): number;\nexport declare function monotone(stops: string[]): boolean;"
        },
        {
          "file": "exact.ts",
          "declarations": "export type Grid = {\n    rows: number;\n    cols: number;\n    channels: number;\n    P: Float64Array[];\n};\nexport declare function buildGrid(values: ArrayLike<number>[], rows: number, cols: number): Grid;\nexport declare function boxSum(g: Grid, c0: number, c1: number, r0: number, r1: number, out?: number[]): number[];\nexport declare const cellOf: (g: Grid, c: number, r: number, out?: number[]) => number[];\nexport declare function gpuPrefix(g: Grid): Uint32Array;\nexport declare function gpuExact(g: Grid): {\n    ok: boolean;\n    largest: number[];\n};\nexport declare function splitInt(total: number, weights: ArrayLike<number>, out?: Int32Array): Int32Array;"
        },
        {
          "file": "fallback.ts",
          "declarations": "import { type Measure } from './measure';\nimport type { SheetModel } from './model';\nexport type FallbackOptions = {\n    model: SheetModel;\n    measures: Measure[];\n    measure: string;\n    level?: number;\n    reason?: string;\n    findings?: Array<{\n        title: string;\n        line: string;\n        when: string;\n    }>;\n    nouns?: [\n        string,\n        string\n    ];\n};\nexport declare function renderFallback(el: HTMLElement, o: FallbackOptions): {\n    update: (id: string) => void;\n    dispose(): void;\n};"
        },
        {
          "file": "formula-remap.ts",
          "declarations": "export type ColumnMap = (col: number) => number | null;\nexport type Merge = {\n    c0: number;\n    r0: number;\n    c1: number;\n    r1: number;\n};\nexport declare const MAX_COLUMN = 16384;\nexport declare function colIndex(letters: string): number;\nexport declare function colLetters(n: number): string;\nexport declare const insertColumns: (at: number, count?: number) => ColumnMap;\nexport declare const deleteColumns: (from: number, to?: number) => ColumnMap;\nexport declare const moveColumn: (from: number, to: number) => ColumnMap;\nexport declare const chain: (...maps: ColumnMap[]) => ColumnMap;\nexport declare const mapOf: (record: Record<number, number | null>) => ColumnMap;\nexport declare function remapFormula(formula: string, map: ColumnMap): string;\nexport declare const isBroken: (formula: string) => boolean;\nexport declare function remapMerges(merges: readonly Merge[], map: ColumnMap, width: number): Merge[];\nexport declare function parseRange(a1: string): Merge;\nexport declare const formatRange: (m: Merge) => string;\nexport declare function toTemplate(formula: string, row: number): string;\nexport declare function fillRow(formula: string, row: number): string;"
        },
        {
          "file": "measure.ts",
          "declarations": "import type { SheetModel } from './model';\nexport type FormatMode = 'exact' | 'compact' | 'short';\nexport type Measure = {\n    id: string;\n    label: string;\n    kind: 'sum' | 'ratio' | 'share' | 'change';\n    a: number;\n    b?: number;\n    shift?: number;\n    presence?: number;\n    format(v: number, mode: FormatMode): string;\n};\nexport declare function measureValue(m: Measure, cur: number[], ly?: number[] | null): number | null;\nexport declare function cellValue(model: SheetModel, m: Measure, t0: number, t1: number, s0: number, s1: number): {\n    cur: number[];\n    ly: number[] | null;\n    v: number | null;\n};\nexport type Scale = {\n    lo: number;\n    hi: number;\n    gamma: number;\n};\nexport declare function scaleFor(model: SheetModel, m: Measure, v: {\n    t0: number;\n    t1: number;\n    r0: number;\n    r1: number;\n}, level: number): Scale | null;\nexport type ScopeCell = {\n    t0: number;\n    t1: number;\n    inScope: boolean;\n    cur: number[];\n    ly: number[] | null;\n    v: number | null;\n};\nexport type ScopeRow = {\n    s: number;\n    cur: number[];\n    ly: number[] | null;\n    v: number | null;\n    rank?: number;\n};\nexport type Scope = {\n    measure: Measure;\n    level: number;\n    tA: number;\n    tB: number;\n    sA: number;\n    sB: number;\n    lyFrom: number | null;\n    cols: ScopeCell[];\n    rows: ScopeRow[];\n    total: number[];\n    ly: number[] | null;\n    value: number | null;\n    ranked: number;\n    nCols: number;\n    colMax: number;\n    colLo: number;\n    rowMax: number;\n    rowLo: number;\n};\nexport declare function computeScope(model: SheetModel, m: Measure, v: {\n    t0: number;\n    t1: number;\n    r0: number;\n    r1: number;\n}, level: number): Scope;\nexport type TableCell = {\n    cur: number[];\n    v: number | null;\n};\nexport type SheetTable = {\n    measure: Measure;\n    level: number;\n    cols: Array<[\n        number,\n        number\n    ]>;\n    colNames: string[];\n    rows: Array<{\n        s0: number;\n        s1: number;\n        name: string;\n        where: string;\n        cells: TableCell[];\n        total: TableCell;\n    }>;\n    foot: TableCell[];\n    total: TableCell;\n    byRow: boolean;\n};\nexport declare function tableOf(model: SheetModel, sc: Scope, { maxCols, maxRows }?: {\n    maxCols?: number | undefined;\n    maxRows?: number | undefined;\n}): SheetTable;"
        },
        {
          "file": "model.ts",
          "declarations": "import type { Axis } from './calendar';\nimport { type Grid } from './exact';\nimport type { RowTree } from './rows';\nexport type FineSplit = (r: number, c: number, out: Int32Array) => void;\nexport type SheetModel = {\n    grid: Grid;\n    axis: Axis;\n    tree: RowTree;\n    rows: number;\n    cols: number;\n    channels: number;\n    per: number;\n    sum(t0: number, t1: number, s0: number, s1: number, out?: number[]): number[];\n    fineOf(r: number, c: number): Int32Array;\n    block(c: number): Float64Array;\n};\nexport declare function createModel({ grid, axis, tree, fine }: {\n    grid: Grid;\n    axis: Axis;\n    tree: RowTree;\n    fine?: FineSplit;\n}): SheetModel;"
        },
        {
          "file": "rows.ts",
          "declarations": "export type RowSpec = {\n    name: string;\n    id?: string;\n    short?: string;\n    note?: string;\n    children?: RowSpec[];\n};\nexport type RowNode = {\n    id: string;\n    name: string;\n    short: string;\n    note: string;\n    level: number;\n    parent: RowNode | null;\n    children: RowNode[];\n    s0: number;\n    s1: number;\n    index: number;\n};\nexport type RowTree = {\n    root: RowNode;\n    nodes: RowNode[];\n    levels: RowNode[][];\n    rows: RowNode[];\n    count: number;\n    depth: number;\n    at(level: number, r: number): RowNode;\n    path(n: RowNode): RowNode[];\n    find(q: string | number | RowNode | null | undefined): RowNode | null;\n    holder(a: number, b: number): RowNode;\n};\nexport declare function buildRows(spec: RowSpec): RowTree;"
        },
        {
          "file": "zoom-sheet.ts",
          "declarations": "import { Camera, type View } from './camera';\nimport { type SheetTheme } from './colour';\nimport { type Measure, type Scale, type Scope } from './measure';\nimport type { SheetModel } from './model';\nexport type RegionName = 'sheet' | 'ruler' | 'rows' | 'top' | 'side' | 'mini';\nexport type Cell = {\n    s: number;\n    t0: number;\n    t1: number;\n    level: number;\n};\nexport type Mark = {\n    t0: number;\n    t1: number;\n    s0: number;\n    s1: number;\n    n: number;\n};\nexport type SheetRecord = {\n    at: number;\n    amount: number;\n    words?: string;\n};\nexport type ZoomSheetOptions = {\n    canvas: HTMLCanvasElement;\n    model: SheetModel;\n    measures: Measure[];\n    measure?: string;\n    regions: Partial<Record<RegionName, HTMLElement>>;\n    theme?: SheetTheme;\n    font?: string;\n    nouns?: [\n        string,\n        string\n    ];\n    marks?: Mark[];\n    records?: (r: number, c: number, h: number) => SheetRecord[];\n    recordFormat?: (amount: number) => string;\n    minSpan?: [\n        number,\n        number\n    ];\n    calm?: boolean;\n    onScope?(scope: Scope, scale: Scale | null): void;\n    onHover?(cell: Cell | null): void;\n    onPins?(pins: Cell[]): void;\n    onRead?(cell: Cell): void;\n    onDive?(cell: Cell): void;\n    onMark?(mark: Mark): void;\n};\nexport type ZoomSheet = {\n    camera: Camera;\n    readonly scope: Scope | null;\n    readonly scale: Scale | null;\n    readonly level: number;\n    readonly hover: Cell | null;\n    readonly pins: Cell[];\n    setMeasure(id: string): void;\n    setTheme(theme: SheetTheme): void;\n    setMarks(marks: Mark[], chosen?: number | null): void;\n    setCalm(on: boolean): void;\n    flyTo(view: View, opts?: {\n        duration?: number;\n        instant?: boolean;\n    }): void;\n    frameOf(ta: number, tb: number, sa: number, sb: number): View;\n    home(): void;\n    cell(s: number, t: number): Cell;\n    cellAt(clientX: number, clientY: number): Cell | null;\n    setHover(cell: Cell | null): void;\n    pin(cell: Cell | null): void;\n    key(e: KeyboardEvent): boolean;\n    invalidate(): void;\n    settle(): Promise<void>;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare function createZoomSheet(o: ZoomSheetOptions): Promise<ZoomSheet | null>;"
        }
      ],
      "pitfalls": [
        "The GPU sums are unsigned 32-bit, modulo 2^32",
        "Channels are integers",
        "The fine split (hours) must add up to its cell exactly",
        "Every leaf of the row tree must sit at the same depth",
        "Columns are days and at most 65,535 (the bounds texture packs start and end into 16 bits each)",
        "Lay the regions out in CSS and keep them over the canvas",
        "Nothing draws while nothing changes",
        "Text is drawn by the GPU in the font you pass",
        "Without WebGPU createZoomSheet resolves to null",
        "remapFormula reads A1-style references written in capitals (a spreadsheet stores them so)",
        "Remap every formula with the same map, before you splice the columns themselves",
        "The detector reads the whole history of every node"
      ],
      "card": "entries/exact-zoom-sheet.json"
    },
    {
      "id": "ferrofluid",
      "aliases": [],
      "name": "Ferrofluid pools & field lines",
      "summary": "Liquid metal under the cards of a board, drawn by the GPU from a few numbers a card. Every card floats in a pool of ferrofluid: one instanced quad a card whose fragment smoothly joins its rounded rim with its four nearest neighbours’, so cards brought close run into one pool, with beads that swell out of the edge, a slow living ripple and an edge that reaches for the pointer; the surface is a meniscus mirroring a photo studio (a softbox, tinted strips, a ring light), in chrome, gold, or cobalt and bismuth through a thin film. Hover a card and the liquid along its rim stands up in Rosensweig spikes, instanced cones tallest near the pointer, while iron filings on the bench line up along a magnet’s field. Each connector becomes a bundle of iridescent field lines fanned from card to card, a pulse running along it as fast as work flows. It is four meshes of TSL node materials for three.js’s WebGPU renderer (pools, spikes, filings and lines, up to 256 cards and 128 connectors) added to an orthographic scene in board units: setPools and setRoutes upload only when their input changes, and update() says whether the spikes and the magnet still move, so a render-on-demand board can rest. At rest with seven cards and six connectors it measured about 0.2 ms of GPU and 0.2 ms of CPU a frame at 1080p. Use it as the signature surface of a canvas, whiteboard or node-graph app, or a hero section whose linked cards should feel alive.",
      "category": "surface",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "expressive",
      "tags": [
        "sdf",
        "smooth union",
        "instancing",
        "iridescence",
        "canvas",
        "board",
        "tsl",
        "hover"
      ],
      "useCases": [
        "canvas and whiteboard apps",
        "dashboards with linked cards",
        "node graphs",
        "hover states with character",
        "product hero sections"
      ],
      "interaction": "Drag the cards together to fuse their pools · hover a card to raise its spikes",
      "kits": [],
      "pairsWith": [
        {
          "id": "connectors-layouts",
          "why": "Field lines along routed connectors"
        },
        {
          "id": "infinite-canvas",
          "why": "Cards on a board that pools follow"
        },
        {
          "id": "card-springs",
          "why": "Cards that lift off the liquid metal"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.80",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-03",
          "gpuMs": 0.202,
          "cpuMs": 0.19,
          "cpuP95Ms": 0.34,
          "badge": "light",
          "drawCalls": 6,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured at rest with the pointer off the board: the pools, field lines and their living surface; the spikes and filings add a little while a card is hovered."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.704,
          "cpuMs": 0.49,
          "cpuP95Ms": 0.875,
          "badge": "moderate",
          "drawCalls": 6,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 6.905,
            "p99Ms": 9.63,
            "low1Fps": 101.5
          },
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 720 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 1.312,
          "cpuMs": 0.22,
          "cpuP95Ms": 0.44,
          "badge": "moderate",
          "drawCalls": 6,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 516 ms."
        }
      ],
      "signatures": [
        {
          "file": "ferro.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nexport type Pool = {\n    cx: number;\n    cy: number;\n    hw: number;\n    hh: number;\n    r: number;\n    rot: number;\n    z: number;\n};\nexport type FieldRoute = {\n    points: readonly {\n        x: number;\n        y: number;\n        z: number;\n    }[];\n    share: number;\n};\nexport type Magnet = {\n    pool: Pool | null;\n    x: number;\n    y: number;\n    on: boolean;\n};\nexport declare const FLUIDS: {\n    readonly chrome: {\n        readonly tint: \"#cfd8e6\";\n        readonly accent: \"#d6e4ff\";\n        readonly film: 0;\n        readonly shift: 0;\n        readonly cast: 0.12;\n    };\n    readonly gold: {\n        readonly tint: \"#ffcf6e\";\n        readonly accent: \"#f2c45e\";\n        readonly film: 0;\n        readonly shift: 0;\n        readonly cast: 1;\n    };\n    readonly cobalt: {\n        readonly tint: \"#86b4ff\";\n        readonly accent: \"#6fb4ff\";\n        readonly film: 0.6;\n        readonly shift: 0.55;\n        readonly cast: 0.35;\n    };\n    readonly bismuth: {\n        readonly tint: \"#ffffff\";\n        readonly accent: \"#ff9ad6\";\n        readonly film: 1;\n        readonly shift: 0.1;\n        readonly cast: 0;\n    };\n};\nexport type Fluid = keyof typeof FLUIDS;\nexport declare const POOL_CAP = 256;\nexport declare function neighbours(pools: readonly Pool[], reach: number): number[][];\nexport declare function resample(points: readonly {\n    x: number;\n    y: number;\n    z: number;\n}[], n?: number): {\n    x: number;\n    y: number;\n    z: number;\n}[];\nexport declare class Ferro {\n    readonly pools: THREE.Mesh;\n    readonly spikes: THREE.Mesh;\n    readonly filings: THREE.Mesh;\n    readonly lines: THREE.Mesh;\n    readonly time: THREE.UniformNode<\"float\", number>;\n    readonly persp: THREE.UniformNode<\"float\", number>;\n    readonly unit: THREE.UniformNode<\"float\", number>;\n    readonly pixels: THREE.UniformNode<\"float\", number>;\n    readonly tint: THREE.UniformNode<\"color\", THREE.Color>;\n    readonly accent: THREE.UniformNode<\"color\", THREE.Color>;\n    readonly film: THREE.UniformNode<\"float\", number>;\n    readonly shift: THREE.UniformNode<\"float\", number>;\n    readonly cast: THREE.UniformNode<\"float\", number>;\n    readonly rim: THREE.UniformNode<\"float\", number>;\n    readonly spikeK: THREE.UniformNode<\"float\", number>;\n    readonly filingsK: THREE.UniformNode<\"float\", number>;\n    readonly ptr: THREE.UniformNode<\"vec2\", THREE.Vector2>;\n    readonly power: THREE.UniformNode<\"float\", number>;\n    readonly hovRect: THREE.UniformNode<\"vec4\", THREE.Vector4>;\n    readonly hovInfo: THREE.UniformNode<\"vec4\", THREE.Vector4>;\n    readonly rise: THREE.UniformNode<\"float\", number>;\n    readonly spikeCount: THREE.UniformNode<\"float\", number>;\n    readonly spacing: THREE.UniformNode<\"float\", number>;\n    readonly perimeter: THREE.UniformNode<\"float\", number>;\n    readonly flowing: THREE.UniformNode<\"float\", number>;\n    constructor();\n    get meshes(): THREE.Mesh[];\n    setMode(on: boolean): void;\n    setLook(fluid: Fluid, rim: number, spikes: number, filings: number): void;\n    setPools(pools: readonly Pool[]): void;\n    setRoutes(routes: readonly FieldRoute[]): void;\n    setMagnet(m: Magnet): void;\n    update(dt: number, inUse: boolean, unit: number, pixels: number): boolean;\n    dispose(): void;\n}"
        }
      ],
      "pitfalls": [
        "Each pixel is drawn by the pool whose card is nearest (the others discard it)",
        "setPools and setRoutes compare a key of their input and only upload on change",
        "Board units are CSS pixels here",
        "The camera is orthographic with y down (top < bottom), which mirrors the projection",
        "update() returns whether it still moves"
      ],
      "card": "entries/ferrofluid.json"
    },
    {
      "id": "fft-ocean",
      "aliases": [],
      "name": "FFT ocean",
      "summary": "An open sea from a wind-wave spectrum (Tessendorf), summed back to heights, choppy sideways push and folds by a Stockham FFT on the GPU every frame, into textures that tile seamlessly. Two cascades, a ring mesh to the horizon, Fresnel sky reflection, a sun glint that broadens properly with distance, light through the crests, foam and haze. The wind’s waves grow with the open water upwind: a lake or a bay gets the lower, shorter, quicker sea that fetch allows (JONSWAP’s growth laws), the open ocean a fully developed one. Without WebGPU the same runs on WebGL2.",
      "category": "simulation",
      "role": "hero-visual",
      "stack": [
        "webgpu"
      ],
      "character": "balanced",
      "tags": [
        "fft",
        "tessendorf",
        "ocean",
        "water",
        "compute",
        "wgsl",
        "raw webgpu",
        "cascades",
        "mipmaps",
        "fetch",
        "jonswap",
        "lakes",
        "wind waves",
        "webgl2 fallback"
      ],
      "useCases": [
        "open-water scenes in games",
        "sailing and flight sims",
        "hero backgrounds and title screens",
        "coastal and weather visualisations",
        "height and normal maps for your own water shader",
        "lakes, bays and sheltered water that should not look like the open ocean"
      ],
      "interaction": "Drag to look around · arrow keys too (Shift for bigger steps) · try Open water upwind",
      "kits": [],
      "pairsWith": [
        {
          "id": "physical-sky",
          "why": "The sky the sea reflects"
        },
        {
          "id": "water-ripples",
          "why": "Wakes and ripples close to the camera"
        },
        {
          "id": "vehicle-models",
          "why": "An airboat on the swell"
        }
      ],
      "variants": [],
      "version": "1.1.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 4.771,
          "cpuMs": 0.11,
          "cpuP95Ms": 0.18,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "The default sea at golden hour: two 256² cascades transformed every frame (spectrum, row and column FFTs, assemble, mips), the sky and far-sea pass and the ~370k-triangle ring mesh at 4× MSAA, timed with its own timestamp queries. The waves move by themselves."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 4.26,
          "cpuMs": 0.27,
          "cpuP95Ms": 0.415,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 418 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 6.524,
          "cpuMs": 0.24,
          "cpuP95Ms": 0.34,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 123 ms."
        }
      ],
      "signatures": [
        {
          "file": "ocean-fft.ts",
          "declarations": "export type WaveSpectrum = {\n    wind: number;\n    direction: number;\n    height?: number;\n    spread?: number;\n    swell?: number;\n    swellDirection?: number;\n    swellLength?: number;\n    seed?: number;\n    fetch?: number;\n};\nexport type Cascade = {\n    n: number;\n    size: number;\n    band?: [\n        number,\n        number\n    ];\n};\nexport declare const seaHeight: (wind: number) => number;\nexport declare function fetchLimited(wind: number, fetch?: number): {\n    height: number;\n    period: number;\n    peakLength: number;\n    share: number;\n    scale: number;\n};\nexport declare const windSeaHeight: (s: Pick<WaveSpectrum, \"wind\" | \"height\" | \"fetch\">) => number;\nexport declare function spectrum(s: WaveSpectrum, c: Cascade, reference?: {\n    n: number;\n    size: number;\n}, seed?: number): Float32Array<ArrayBuffer>;\nexport declare class OceanFFT {\n    readonly cascade: Cascade;\n    readonly displacement: GPUTexture;\n    readonly slope: GPUTexture;\n    chop: number;\n    static create(device: GPUDevice, c: Cascade, waves: WaveSpectrum, opts?: {\n        chop?: number;\n        reference?: {\n            n: number;\n            size: number;\n        };\n        seed?: number;\n    }): Promise<OceanFFT>;\n    setSpectrum(waves: WaveSpectrum, reference?: {\n        n: number;\n        size: number;\n    }, seed?: number): void;\n    run(encoder: GPUCommandEncoder, t: number, timestampWrites?: GPUComputePassTimestampWrites): void;\n    dispose(): void;\n}"
        },
        {
          "file": "ocean-gl.ts",
          "declarations": "import { type FullScreenTriangle } from './webgl2-pingpong';\nimport { type Cascade, type WaveSpectrum } from './ocean-fft';\nimport { type OceanOptions, type SeaCamera, type SeaLook, type SeaTile } from './ocean-view';\ntype Programs = {\n    spec: WebGLProgram;\n    stage: WebGLProgram;\n    assemble: WebGLProgram;\n};\nexport declare class OceanFFTGL {\n    readonly cascade: Cascade;\n    readonly displacement: WebGLTexture;\n    readonly slope: WebGLTexture;\n    chop: number;\n    static create(gl: WebGL2RenderingContext, programs: Programs, tri: FullScreenTriangle, c: Cascade, waves: WaveSpectrum, opts?: {\n        chop?: number;\n        reference?: {\n            n: number;\n            size: number;\n        };\n        seed?: number;\n    }): OceanFFTGL | null;\n    setSpectrum(waves: WaveSpectrum, reference?: {\n        n: number;\n        size: number;\n    }, seed?: number): void;\n    run(t: number): void;\n    dispose(): void;\n}\nexport declare class OceanViewGL {\n    readonly gl: WebGL2RenderingContext;\n    look: SeaLook;\n    camera: SeaCamera;\n    cascades: OceanFFTGL[];\n    static create(canvas: HTMLCanvasElement, waves: WaveSpectrum, opts?: OceanOptions): OceanViewGL | null;\n    setGrid(n: number, cell?: number): boolean;\n    setWaves(waves: WaveSpectrum): void;\n    set chop(v: number);\n    get chop(): number;\n    get height(): number;\n    gpuMs(): number | null;\n    render(t: number, opts?: {\n        tiles?: SeaTile[];\n    }): void;\n    dispose(): void;\n}\nexport {};"
        },
        {
          "file": "ocean-view.ts",
          "declarations": "import { OceanFFT, type Cascade, type WaveSpectrum } from './ocean-fft';\nexport type Vec3 = [\n    number,\n    number,\n    number\n];\nexport type SeaLook = {\n    sunElevation: number;\n    sunAzimuth: number;\n    sunStrength: number;\n    deep: Vec3;\n    foam: number;\n    haze: number;\n    exposure: number;\n    roughness: number;\n    crestLight: number;\n};\nexport type SeaCamera = {\n    pos: Vec3;\n    yaw: number;\n    pitch: number;\n    fov: number;\n};\nexport type SeaTile = {\n    x: number;\n    y: number;\n    size: number;\n    show: 'height' | 'normal' | 'folds';\n};\nexport type OceanOptions = {\n    n?: number;\n    size?: number;\n    detail?: number;\n    chop?: number;\n    cell?: number;\n    sampleCount?: 1 | 4;\n};\nexport declare const DEFAULT_LOOK: SeaLook;\nexport declare const UNIFORM_FLOATS: number;\nexport declare const KIND: {\n    readonly height: 0;\n    readonly normal: 1;\n    readonly folds: 2;\n};\nexport declare function seaMesh(fine: number): {\n    verts: Float32Array<ArrayBuffer>;\n    index: Uint32Array<ArrayBuffer>;\n};\nexport declare function sunColour(elevation: number): Vec3;\nexport declare const fromAngles: (az: number, el: number) => Vec3;\nexport declare function cameraMatrices(cam: SeaCamera, aspect: number, near?: number): {\n    r: Vec3;\n    u: Vec3;\n    f: Vec3;\n    vp: Float32Array;\n};\nexport declare function cascadesFor(n: number, size: number, detail: number): {\n    n: number;\n    size: number;\n    band: [\n        number,\n        number\n    ];\n}[];\nexport declare function seaUniforms(x: Float32Array, L: SeaLook, cam: SeaCamera, w: number, h: number, t: number, a: Cascade, b: Cascade, cell: number, height: number): void;\nexport declare class OceanView {\n    look: SeaLook;\n    camera: SeaCamera;\n    cascades: OceanFFT[];\n    static create(device: GPUDevice, format: GPUTextureFormat, waves: WaveSpectrum, opts?: OceanOptions): Promise<OceanView>;\n    setGrid(n: number, cell?: number): Promise<void>;\n    setWaves(waves: WaveSpectrum): void;\n    set chop(v: number);\n    get chop(): number;\n    get height(): number;\n    render(encoder: GPUCommandEncoder, target: GPUTexture, t: number, opts?: {\n        tiles?: SeaTile[];\n        timestamps?: {\n            querySet: GPUQuerySet;\n            begin: number;\n            end: number;\n        };\n    }): void;\n    dispose(): void;\n}"
        }
      ],
      "pitfalls": [
        "In a wind under about 3 m/s the spectrum’s peak lies in waves shorter than a 300 m tile’s grid…",
        "The FFT size must be a power of two from 64 to 512",
        "Changing the wind, height or swell remakes the spectrum on the CPU",
        "Sample the slope texture with mipmaps and anisotropic filtering",
        "Keep the long cascade’s tile well over the longest wave (the peak is ~7.7 V² / g)",
        "The sideways push is in the textures, so a point’s height is at its displaced place",
        "Pipelines compile in the background (createComputePipelineAsync, createRenderPipelineAsync)",
        "Never queue more than one frame ahead",
        "Without WebGPU, use OceanViewGL (ocean-gl.ts) on a canvas of its own",
        "A fully developed sea needs a long fetch (about 175 km at 10 m/s, more in stronger wind)"
      ],
      "card": "entries/fft-ocean.json"
    },
    {
      "id": "fibre-light",
      "aliases": [],
      "name": "Fibre light",
      "summary": "Light racing through glass fibres: a laser lights a bundle’s polished face, the light’s front runs down thousands of fibres, out through a network of glass beads and into the letters of any word engraved in a plate of smoked glass. The fibres are drawn as ribbons along their curves and blended by weight in any order, so a packed bundle glows as one; a whole show is a function of one progress value, the same frame every time.",
      "category": "surface",
      "role": "hero-visual",
      "stack": [
        "webgpu"
      ],
      "character": "expressive",
      "tags": [
        "glass",
        "fibre optics",
        "order-independent transparency",
        "weighted blended",
        "catmull-rom",
        "instanced ribbons",
        "text",
        "splash",
        "stage",
        "deterministic",
        "wgsl",
        "raw webgpu"
      ],
      "useCases": [
        "title cards and splash screens",
        "the opening of a talk or a live show",
        "a hero section about networks, data or signals",
        "loading moments with a progress to show",
        "a held, calm moment on a stage that stays alive"
      ],
      "interaction": "Drag or use the arrow keys to look around · Enter to replay · Escape to reset the view",
      "kits": [],
      "pairsWith": [
        {
          "id": "circuit-from-text",
          "why": "The same word as a circuit board"
        },
        {
          "id": "glass-engraving",
          "why": "The same word engraved in glass"
        },
        {
          "id": "cinematic-lens",
          "why": "Bloom and a grade on the light"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 5.68,
          "cpuMs": 0.155,
          "cpuP95Ms": 0.255,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "The whole show played over and over at Effect speed 1 (medium quality, about 3,000 fibres at 84 segments each, 63 beads): the room traced, the fibres and beads blended by weight, the plate, a quarter-size bloom and the composite; timed with its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 3.801,
          "cpuMs": 0.34,
          "cpuP95Ms": 0.545,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 277 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 6.319,
          "cpuMs": 0.4,
          "cpuP95Ms": 0.5,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 206 ms."
        }
      ],
      "signatures": [
        {
          "file": "engraving.ts",
          "declarations": "import { type Coverage } from './plan';\nexport type EngravingArt = {\n    levels: HTMLCanvasElement[];\n    title: Coverage;\n    line: Coverage | null;\n    text: {\n        title: string;\n        line: string;\n    };\n};\nexport type EngravingOptions = {\n    family?: string;\n    weight?: number | string;\n    size?: number;\n    capitals?: boolean;\n};\nexport declare function drawEngraving(title: string, line?: string, { family, weight, size, capitals }?: EngravingOptions, doc?: Document): EngravingArt;"
        },
        {
          "file": "fibre-light.ts",
          "declarations": "import type { EngravingArt } from './engraving';\nimport { type FibreQuality } from './plan';\nimport type { Lens, Phases } from './tour';\nexport type FibreColours = {\n    glow: string;\n    accent: string;\n    ink: string;\n    line: string;\n    top: string;\n    bottom: string;\n};\nexport type FibreLook = {\n    glow: number;\n    trail: number;\n    haze: number;\n    smoke: number;\n    thoughts: number;\n    bloom: number;\n    width: number;\n};\nexport type FibreView = {\n    camera: Lens;\n    phases: Partial<Phases>;\n    time: number;\n    exposure?: number;\n};\nexport type FibreLightOptions = {\n    device?: GPUDevice;\n    quality?: FibreQuality;\n    colours?: Partial<FibreColours>;\n    look?: Partial<FibreLook>;\n    seed?: number;\n};\nexport type FibreLight = {\n    readonly device: GPUDevice;\n    setEngraving(art: EngravingArt): void;\n    setQuality(quality: FibreQuality): void;\n    setColours(colours: Partial<FibreColours>): void;\n    setLook(look: Partial<FibreLook>): void;\n    draw(view: FibreView): boolean;\n    warm(views: FibreView[]): Promise<void>;\n    readonly counts: {\n        fibres: number;\n        beads: number;\n    };\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare const DEFAULT_COLOURS: FibreColours;\nexport declare const DEFAULT_LOOK: FibreLook;\nexport declare function createFibreLight(canvas: HTMLCanvasElement, options?: FibreLightOptions): Promise<FibreLight | null>;"
        },
        {
          "file": "still.ts",
          "declarations": "import type { FibreColours } from './fibre-light';\nexport type FibreStillOptions = {\n    title: string;\n    line?: string;\n    family?: string;\n    weight?: number | string;\n    colours?: Partial<Pick<FibreColours, 'glow' | 'ink' | 'line' | 'top' | 'bottom'>>;\n    shine?: number;\n    seed?: number;\n};\nexport declare function drawFibreStill(g: CanvasRenderingContext2D, { title, line, family, weight, colours, shine, seed }: FibreStillOptions): void;"
        },
        {
          "file": "tour.ts",
          "declarations": "import type { V3 } from './plan';\nexport declare const TOUR_SECONDS = 20;\nexport type Ease = 'in' | 'out' | 'inOut';\nexport type Shot = {\n    at: number;\n    name: string;\n    target: V3;\n    azimuth: number;\n    elevation: number;\n    distance: number;\n    fov: number;\n    ease?: Ease;\n    cut?: boolean;\n};\nexport type Lens = {\n    eye: V3;\n    target: V3;\n    fovY: number;\n};\nexport declare const TOUR: readonly Shot[];\nexport declare function eyeOf(s: Pick<Shot, 'target' | 'azimuth' | 'elevation' | 'distance'>): V3;\nexport declare function lensAt(shots: readonly Shot[], t: number): Lens;\nexport declare function shotAt(shots: readonly Shot[], t: number): Shot;\nexport declare function fitLens(lens: Lens, aspect: number, yaw?: number, pitch?: number): Lens;\nexport declare function tourAt(progress: number, aspect?: number, yaw?: number, pitch?: number): Lens;\nexport type Phases = {\n    fade: number;\n    ignite: number;\n    signal: number;\n    shine: number;\n    think: number;\n    line: number;\n};\nexport declare function phasesAt(progress: number): Phases;"
        }
      ],
      "pitfalls": [
        "Planning the fibres is CPU work (tens of ms for a few thousand)",
        "The thoughts run on the view’s time",
        "Draw at the canvas’s own width and height",
        "draw returns false while the last frame is still on the GPU",
        "Every fibre is one instance of segments × 6 vertices",
        "The engraving is drawn with the font you name",
        "The camera is fitted to the canvas’s shape (tourAt, fitLens)",
        "Without WebGPU createFibreLight returns null"
      ],
      "card": "entries/fibre-light.json"
    },
    {
      "id": "field-rules",
      "aliases": [],
      "name": "Document field checks",
      "summary": "Decides, for every value read from a document or a form, whether it can be written or a person must look, and says why in plain English. Each field runs an extract regex, then its type (whole number, amount, date), a pattern and a range; amounts are read however they are written (1 234,56 · 1,234.56 · 5,00- · EUR 18,40). Missing or wrong mandatory fields are problems, optional ones warnings; lines must add up to the total; dates in the future, old dates and large amounts follow rules with defaults that each layout overrides. Pure TypeScript, tested.",
      "category": "data",
      "role": "system",
      "stack": [
        "headless"
      ],
      "character": "calm",
      "tags": [
        "validation",
        "parsing",
        "regex",
        "numbers",
        "dates",
        "decimal comma",
        "currency",
        "totals",
        "line items",
        "rules",
        "defaults and overrides",
        "plain-English messages",
        "review",
        "import",
        "ingest",
        "OCR",
        "pure",
        "tested",
        "no dependencies"
      ],
      "useCases": [
        "reading receipts, statements and forms into a table",
        "deciding which imported rows need a person",
        "checking that line items add up to a total",
        "amounts and dates typed in any common format",
        "rules per sender, supplier or layout over shared defaults",
        "messages a person can act on, not error codes"
      ],
      "interaction": "Edit any value on the receipt · break the total, the date or the receipt number · change this layout’s rules in the panel",
      "kits": [],
      "pairsWith": [
        {
          "id": "pdf-field-map",
          "why": "Where each value sits on the page"
        },
        {
          "id": "review-queue",
          "why": "Where the values a person must check wait"
        },
        {
          "id": "units-math",
          "why": "Totals and units checked before writing"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": null,
          "cpuMs": 0.435,
          "cpuP95Ms": 0.695,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.11,
            "p99Ms": 17.055,
            "low1Fps": 57.3
          },
          "notes": "Measured with the demo editing itself: every frame it types one character into the total (then takes it out again), so each frame runs the whole check (six fields, three lines, the sum and the date rules) and repaints the receipt’s marks and the step table. Nothing runs while nothing is typed."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.68,
          "cpuP95Ms": 1.005,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 32 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.7,
          "cpuP95Ms": 1.9,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 102 ms."
        }
      ],
      "signatures": [
        {
          "file": "field-rules.ts",
          "declarations": "import { type FieldType, type Value } from './parse';\nexport type { FieldType, Value } from './parse';\nexport type FieldRule = {\n    name: string;\n    label?: string;\n    type?: FieldType;\n    mandatory?: boolean;\n    extract?: string;\n    pattern?: string;\n    hint?: string;\n    min?: number | null;\n    max?: number | null;\n    dateFormat?: string;\n};\nexport type TableRule = {\n    kind: 'table';\n    name: string;\n    label?: string;\n    mandatory?: boolean;\n    columns: FieldRule[];\n};\nexport type SumCheck = {\n    kind: 'sum';\n    table: string;\n    column: string;\n    plus?: string[];\n    equals: string;\n    tolerance?: number;\n};\nexport type Rules = {\n    totalMismatch: 'problem' | 'warning';\n    tolerance: number;\n    futureDates: 'problem' | 'allow';\n    maxAgeDays: number | null;\n    maxAmount: number | null;\n    dateField: string | null;\n    amountField: string | null;\n};\nexport type Layout = {\n    id?: string;\n    name?: string;\n    fields: Array<FieldRule | TableRule>;\n    checks?: SumCheck[];\n    rules?: Partial<Rules>;\n};\nexport type Status = 'ok' | 'missing' | 'invalid';\nexport type Step = 'extract' | 'type' | 'pattern' | 'range';\nexport type FieldResult = {\n    kind: 'value';\n    name: string;\n    label: string;\n    mandatory: boolean;\n    raw: string;\n    text: string;\n    value: Value | null;\n    status: Status;\n    failedAt: Step | null;\n    message: string;\n};\nexport type TableResult = {\n    kind: 'table';\n    name: string;\n    label: string;\n    mandatory: boolean;\n    rows: Array<Record<string, FieldResult>>;\n    lines: number[];\n    status: Status;\n    message: string;\n};\nexport type Finding = {\n    field: string | null;\n    label: string;\n    message: string;\n    status: Status | 'check' | 'rule';\n};\nexport type Verdict = {\n    fields: Record<string, FieldResult | TableResult>;\n    problems: Finding[];\n    warnings: Finding[];\n    rules: Rules;\n    ok: boolean;\n};\nexport type RecordInput = Record<string, string | null | undefined | Array<Record<string, string | null | undefined>>>;\nexport type CheckOptions = {\n    today?: string;\n    decimalMark?: ',' | '.';\n    formatNumber?: (n: number) => string;\n    rules?: Partial<Rules>;\n};\nexport declare const DEFAULT_RULES: Readonly<Rules>;\nexport declare function resolveRules(defaults?: Partial<Rules>, ...overrides: Array<Partial<Rules> | null | undefined>): Rules;\nexport declare function overridesOf(rules: Partial<Rules>, defaults?: Partial<Rules>): Partial<Rules>;\nexport declare function evaluate(rule: FieldRule, raw: string | null | undefined, opts?: Pick<CheckOptions, 'decimalMark' | 'formatNumber'>): FieldResult;\nexport declare function evaluateTable(rule: TableRule, rows: Array<Record<string, string | null | undefined>> | null | undefined, opts?: Pick<CheckOptions, 'decimalMark' | 'formatNumber'>): TableResult;\nexport declare function runSum(check: SumCheck, fields: Verdict['fields'], tolerance: number, fmt?: (n: number) => string): string | null;\nexport declare function checkRecord(layout: Layout, input: RecordInput, opts?: CheckOptions): Verdict;\nexport declare function summarise(v: Verdict): {\n    tone: 'ok' | 'warn' | 'bad';\n    text: string;\n};"
        }
      ],
      "pitfalls": [
        "“1,234” is read as 1.234 when the decimal mark is guessed, as in the source",
        "A table skips blank rows, but its messages count lines as given",
        "Dates come back as YYYY-MM-DD strings, never Date objects, so no time zone moves them a day",
        "A pattern must match the whole text (it is wrapped in ^(?:…)$)",
        "Patterns are compiled from strings on every check",
        "The sum check is skipped while a part of it is missing or wrong",
        "Overrides with an unknown key, an empty value or a value the rule doesn’t allow are ignored",
        "Messages quote the text they saw"
      ],
      "card": "entries/field-rules.json"
    },
    {
      "id": "file-drop",
      "aliases": [],
      "name": "File drop and upload list",
      "summary": "A drop zone with a real button, folders walked, paste from the clipboard, and checks by type, size, count and duplicates (by content: a SHA-256 of each file, big ones hashed in slices so nothing stalls, so a renamed copy is caught) with a reason for every file turned away. Image thumbnails are decoded off the main thread only as their rows scroll into view; the list shows progress, cancel, retry and remove per file, a concurrency limit and overall progress, through any uploader you plug in (a plain POST helper ships with it). 500 files dropped at once stay smooth. Plain DOM, no dependencies.",
      "category": "ui",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "file upload",
        "drag and drop",
        "drop zone",
        "folders",
        "paste",
        "validation",
        "duplicates",
        "sha-256",
        "content hash",
        "crypto.subtle",
        "progress",
        "thumbnails",
        "createImageBitmap",
        "IntersectionObserver",
        "XMLHttpRequest",
        "live region",
        "accessibility",
        "keyboard",
        "touch",
        "rtl",
        "dom",
        "css",
        "no dependencies"
      ],
      "useCases": [
        "attachments in a form or a message",
        "uploading photos and documents",
        "importing a folder of assets",
        "avatar and single-file fields",
        "pasting screenshots",
        "bulk uploads with retry",
        "catching the same file sent twice under another name"
      ],
      "interaction": "Drop files or a folder on the zone, choose them, or paste · ↑ ↓ move through the list, Delete removes · nothing leaves your browser",
      "kits": [
        {
          "kit": "foundations",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "streaming-spreadsheets",
          "why": "Read a dropped CSV or Excel file without freezing"
        },
        {
          "id": "file-io",
          "why": "Files out to match the files in"
        },
        {
          "id": "loading-states",
          "why": "States for an upload that is slow or fails"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": null,
          "cpuMs": 0.04,
          "cpuP95Ms": 0.085,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the demo exercising itself: 40 files (eight of them pictures with thumbnails) added every 240 frames and uploaded by the simulated uploader, three at a time, with the list cleared before each batch, while the list scrolls 3 px a frame. Each frame writes only the rows that changed (progress, status) and the summary, in one batch. Nothing runs between changes."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.06,
          "cpuP95Ms": 0.1,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 58 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.3,
          "cpuP95Ms": 4.74,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 86 ms."
        }
      ],
      "signatures": [
        {
          "file": "file-drop.ts",
          "declarations": "import { type FileItem, type Summary, type Uploader } from './queue';\nimport { type HashOptions } from './hash';\nimport { type Messages, type Rejection, type Rules } from './rules';\nimport { type ThumbOptions } from './thumbs';\nexport type { FileItem, Status, Summary, Uploader } from './queue';\nexport type { Rejection } from './rules';\nexport declare const LABELS: {\n    title: string;\n    titleOne: string;\n    over: (n: number) => string;\n    overBad: string;\n    overFull: (max: number) => string;\n    choose: string;\n    chooseOne: string;\n    chooseFolder: string;\n    paste: (keys: string) => string;\n    list: string;\n    waiting: string;\n    ready: string;\n    uploading: (percent: number) => string;\n    done: string;\n    failed: string;\n    cancelled: string;\n    cancel: (name: string) => string;\n    retry: (name: string) => string;\n    remove: (name: string) => string;\n    cancelShort: string;\n    retryShort: string;\n    removeShort: string;\n    progress: (name: string) => string;\n    total: string;\n    summary: (s: Summary, sent: string, bytes: string) => string;\n    uploadAll: (n: number) => string;\n    retryFailed: (n: number) => string;\n    cancelAll: string;\n    clearDone: string;\n    notAdded: (n: number) => string;\n    more: (n: number) => string;\n    dismiss: string;\n    checking: (n: number, percent: number) => string;\n    saidAdded: (n: number, name: string) => string;\n    saidRejected: (n: number, first: string) => string;\n    saidDone: (n: number, name: string) => string;\n    saidAllDone: (n: number) => string;\n    saidFailed: (n: number, name: string, error: string) => string;\n    saidCancelled: (n: number, name: string) => string;\n    saidRemoved: (n: number, name: string) => string;\n};\nexport type Labels = typeof LABELS;\nexport type FileDropOptions<R = unknown> = Rules<File> & {\n    upload?: Uploader<R>;\n    concurrency?: number;\n    autoUpload?: boolean;\n    multiple?: boolean;\n    folders?: boolean;\n    folderButton?: boolean;\n    paste?: boolean | 'document';\n    guardPage?: boolean;\n    dedupe?: boolean | 'content' | 'name';\n    hash?: HashOptions & {\n        maxBytes?: number;\n    };\n    previews?: boolean | ThumbOptions;\n    name?: string;\n    compact?: boolean;\n    locale?: string;\n    labels?: Partial<Labels>;\n    messages?: Partial<Messages>;\n    onAdd?(items: Array<FileItem<R>>): void;\n    onReject?(rejections: Rejection[]): void;\n    onChange?(items: ReadonlyArray<FileItem<R>>, summary: Summary): void;\n    onDone?(item: FileItem<R>): void;\n    onError?(item: FileItem<R>): void;\n    onRemove?(items: Array<FileItem<R>>): void;\n    onIdle?(summary: Summary): void;\n    renderItem?(row: HTMLLIElement, item: FileItem<R>, first: boolean): void;\n    animate?(el: HTMLElement, phase: 'enter' | 'exit', part: 'item' | 'notice'): Promise<unknown> | void;\n};\nexport declare function createFileDrop<R = unknown>(host: HTMLElement, options?: FileDropOptions<R>): {\n    element: HTMLDivElement;\n    readonly value: ReadonlyArray<FileItem<R>>;\n    setValue(files: Array<{\n        name: string;\n        size: number;\n        type?: string;\n        path?: string;\n        result?: R;\n        hash?: string;\n    }>): void;\n    summary: () => Summary;\n    add: (files: Iterable<File> | ArrayLike<File>, path?: string) => Promise<{\n        added: Array<FileItem<R>>;\n        rejected: Rejection[];\n    }>;\n    remove: (id: string | string[]) => void;\n    cancel: (id: string) => void;\n    retry: (id: string) => void;\n    start: () => void;\n    cancelAll(): void;\n    retryFailed(): void;\n    clear: () => void;\n    browse: (folder?: boolean) => void;\n    setOptions(next: Partial<FileDropOptions<R>>): void;\n    destroy(): void;\n};\nexport type FileDrop<R = unknown> = ReturnType<typeof createFileDrop<R>>;"
        },
        {
          "file": "queue.ts",
          "declarations": "import type { Picked } from './rules';\nexport type Status = 'queued' | 'uploading' | 'done' | 'failed' | 'cancelled';\nexport type FileItem<R = unknown> = {\n    readonly id: string;\n    readonly file: File | null;\n    readonly name: string;\n    readonly path: string;\n    readonly size: number;\n    readonly type: string;\n    readonly status: Status;\n    readonly progress: number;\n    readonly error?: string;\n    readonly result?: R;\n    readonly attempts: number;\n    readonly hash?: string;\n};\nexport type UploadContext = {\n    signal: AbortSignal;\n    onProgress(fraction: number): void;\n    item: FileItem;\n};\nexport type Uploader<R = unknown> = (file: File, context: UploadContext) => Promise<R>;\nexport type Change = 'add' | 'start' | 'progress' | 'done' | 'fail' | 'cancel' | 'retry' | 'remove';\nexport type Summary = {\n    total: number;\n    queued: number;\n    uploading: number;\n    done: number;\n    failed: number;\n    cancelled: number;\n    bytes: number;\n    sent: number;\n    progress: number;\n};\nexport type QueueOptions<R = unknown> = {\n    upload?: Uploader<R>;\n    concurrency?: number;\n    autoStart?: boolean;\n    onChange?(kind: Change, items: Array<FileItem<R>>): void;\n    onIdle?(summary: Summary): void;\n};\nexport declare function createQueue<R = unknown>(options?: QueueOptions<R>): {\n    readonly items: ReadonlyArray<FileItem<R>>;\n    get(id: string): FileItem<R> | undefined;\n    readonly paused: boolean;\n    add(picks: Array<Picked<File> & {\n        hash?: string;\n    }>): Array<FileItem<R>>;\n    restore(list: Array<{\n        name: string;\n        size: number;\n        type?: string;\n        path?: string;\n        result?: R;\n        hash?: string;\n    }>): Array<FileItem<R>>;\n    start(): void;\n    cancel(id: string): void;\n    retry(id: string): void;\n    remove(ids: string | string[]): void;\n    setConcurrency(n: number): void;\n    setUploader(upload: Uploader<R> | undefined): void;\n    setAutoStart(on: boolean): void;\n    summary: () => Summary;\n};\nexport type Queue<R = unknown> = ReturnType<typeof createQueue<R>>;"
        },
        {
          "file": "uploaders.ts",
          "declarations": "import type { Uploader } from './queue';\nexport type HttpUploadOptions = {\n    url: string | ((file: File) => string | Promise<string>);\n    method?: 'POST' | 'PUT';\n    field?: string;\n    fields?: Record<string, string> | ((file: File) => Record<string, string>);\n    headers?: Record<string, string> | ((file: File) => Record<string, string> | Promise<Record<string, string>>);\n    withCredentials?: boolean;\n    parse?: (xhr: XMLHttpRequest) => unknown;\n    describe?: (xhr: XMLHttpRequest) => string;\n};\nexport declare function httpUploader<R = unknown>(options: HttpUploadOptions): Uploader<R>;\nexport type SimulatedOptions = {\n    speed?: number | (() => number);\n    latency?: number;\n    failRate?: number;\n    random?: () => number;\n    rate?: number;\n};\nexport declare function simulateUploader(options?: SimulatedOptions): Uploader<{\n    id: string;\n}>;"
        }
      ],
      "pitfalls": [
        "Checks in the browser are a courtesy, not security",
        "Read a drop inside the drop handler",
        "A dropped folder is read in batches (readEntries gives 100 at a time in Chrome)",
        "browse() and the file chooser open only during a click or a key press",
        "guardPage stops a file dropped beside the zone from opening in the tab and leaving your app",
        "Sizes are in powers of 1000, as most systems show them",
        "fetch can’t report upload progress in most browsers yet",
        "Thumbnails are cut from the picture’s width",
        "Firefox and Safari without folder support hand a folder over as an empty file with no type",
        "Duplicates by content read every file the rules take before it is listed",
        "crypto.subtle exists only in secure contexts (https and localhost)",
        "add() resolves once its batch is checked and listed (it used to return at once)",
        "A hash in the browser is a courtesy too",
        "With name set, the hidden input carries the files only where the DataTransfer constructor exists"
      ],
      "card": "entries/file-drop.json"
    },
    {
      "id": "file-io",
      "aliases": [],
      "name": "Files out with no library: PDF from pictures, SVG from shapes",
      "summary": "Writes the files an app hands people, in plain TypeScript: a PDF of JPEG pages written by hand (each picture passed through as it is, its size, colour space and phone turn read from the file, on its own size or fitted on A4 or Letter, titles in any script), an SVG of shapes, text, lines with heads, pictures and paths, a drawn page turned into JPEG bytes through a data: URL, a file kind told from its first bytes, and a download from a click. No blob: URLs but the click’s own, so it runs under a strict Content Security Policy. Reading huge CSV, .xlsx and zip files is streaming-spreadsheets’ part; the demo uses both.",
      "category": "data",
      "role": "system",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "pdf",
        "svg",
        "jpeg",
        "exif",
        "orientation",
        "export",
        "download",
        "file sniffing",
        "magic bytes",
        "zip",
        "xlsx",
        "csv",
        "drag and drop",
        "print",
        "a4",
        "csp",
        "no dependencies"
      ],
      "useCases": [
        "exporting a board, chart or report as PDF and SVG",
        "turning slides or screenshots into one PDF",
        "a PDF of photos taken on a phone, the right way up",
        "telling a dropped file’s kind before reading it",
        "saving files from a static site under a strict Content Security Policy",
        "printable pages without a PDF library"
      ],
      "interaction": "Pick a sample or drop a CSV, an .xlsx or a zip · the page and its PDF follow · save either",
      "kits": [
        {
          "kit": "shop",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "file-drop",
          "why": "Pictures in, PDF out"
        },
        {
          "id": "quiet-charts",
          "why": "Charts saved as SVG"
        },
        {
          "id": "more-chart-types",
          "why": "More charts saved as SVG"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 0.01,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 31.477,
            "p99Ms": 46.015,
            "low1Fps": 19.3
          },
          "notes": "Measured reading plants.csv and writing its page as SVG, a JPEG and a PDF, once every 1.5 s, from memory. Idle, nothing runs."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 0.015,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 68 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.02,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 123 ms."
        }
      ],
      "signatures": [
        {
          "file": "jpeg.ts",
          "declarations": "export type JpegInfo = {\n    width: number;\n    height: number;\n    components: 1 | 3 | 4;\n    bits: number;\n    progressive: boolean;\n    orientation: number;\n    adobe: boolean;\n};\nexport declare class JpegError extends Error {\n}\nexport declare function jpegInfo(bytes: Uint8Array): JpegInfo;\nexport declare function canvasToJpeg(canvas: HTMLCanvasElement | OffscreenCanvas, quality?: number): Promise<Uint8Array>;"
        },
        {
          "file": "pdf.ts",
          "declarations": "export type PdfPage = {\n    jpeg: Uint8Array;\n    width?: number;\n    height?: number;\n    page?: PageSize;\n};\nexport type Paper = {\n    width: number;\n    height: number;\n};\nexport declare const PAPER: {\n    readonly a4: {\n        readonly width: 595.28;\n        readonly height: 841.89;\n    };\n    readonly a5: {\n        readonly width: 419.53;\n        readonly height: 595.28;\n    };\n    readonly letter: {\n        readonly width: 612;\n        readonly height: 792;\n    };\n};\nexport type PageSize = 'picture' | (Paper & {\n    margin?: number;\n    turn?: boolean;\n});\nexport type PdfOptions = {\n    title?: string;\n    producer?: string;\n    author?: string;\n    page?: PageSize;\n    date?: Date | null;\n};\nexport declare function pdfString(s: string): string;\nexport declare function orientMatrix(orientation: number, x: number, y: number, w: number, h: number): [\n    number,\n    number,\n    number,\n    number,\n    number,\n    number\n];\nexport declare function pdfFromJpegs(pages: readonly PdfPage[], opts?: PdfOptions): Uint8Array;\nexport declare function pdfBlobFromJpegs(pages: readonly PdfPage[], opts?: PdfOptions): Blob;\nexport declare const pdfFromJpeg: (jpeg: Uint8Array, opts?: PdfOptions) => Uint8Array;"
        },
        {
          "file": "raster.ts",
          "declarations": "export declare function svgToCanvas(svg: string, opts: {\n    width: number;\n    height: number;\n    scale?: number;\n    background?: string;\n}): Promise<HTMLCanvasElement>;\nexport declare function dataUrl(bytes: Uint8Array, type: string): string;"
        },
        {
          "file": "save.ts",
          "declarations": "export declare function saveFile(data: Blob | Uint8Array | string, name: string, type?: string): void;\nexport declare function bytesLabel(n: number): string;"
        },
        {
          "file": "sniff.ts",
          "declarations": "export type FileKind = 'zip' | 'xlsx' | 'docx' | 'pptx' | 'opendocument' | 'xls' | 'pdf' | 'jpeg' | 'png' | 'gif' | 'webp' | 'svg' | 'text' | 'binary';\nexport type Sniffed = {\n    kind: FileKind;\n    label: string;\n    mime: string;\n};\nexport declare function sniffBytes(head: Uint8Array): Sniffed;\nexport declare function zipKind(names: readonly string[]): Sniffed;\nexport declare function sniffFile(file: Blob): Promise<Sniffed>;"
        },
        {
          "file": "svg.ts",
          "declarations": "type Pt = {\n    x: number;\n    y: number;\n};\nexport type SvgPart = {\n    kind: 'shape';\n    points?: Pt[];\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n    rx: number;\n    rotation: number;\n    fill: string;\n    opacity?: number;\n    stroke?: string;\n    strokeWidth?: number;\n    shadow?: boolean;\n} | {\n    kind: 'text';\n    lines: {\n        text: string;\n        x: number;\n        y: number;\n    }[];\n    size: number;\n    family: string;\n    weight: number;\n    fill: string;\n    rotation: number;\n    cx: number;\n    cy: number;\n    anchor?: 'start' | 'middle' | 'end';\n} | {\n    kind: 'line';\n    points: Pt[];\n    stroke: string;\n    width: number;\n    dash?: string;\n    heads: {\n        at: Pt;\n        dir: Pt;\n        size: number;\n        style: 'arrow' | 'open' | 'dot';\n    }[];\n} | {\n    kind: 'image';\n    href: string;\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n    rotation: number;\n} | {\n    kind: 'path';\n    d: string;\n    fill?: string;\n    stroke?: string;\n    width?: number;\n    opacity?: number;\n    rotation?: number;\n    cx?: number;\n    cy?: number;\n};\nexport type SvgOptions = {\n    idPrefix?: string;\n};\nexport declare function toSvg(parts: readonly SvgPart[], bounds: {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n}, paper: string | null, title: string, opts?: SvgOptions): string;\nexport {};"
        }
      ],
      "pitfalls": [
        "A phone saves an upright photo on its side with an EXIF note to turn it",
        "JPEG has no transparency",
        "A drawn page goes into the PDF as a picture",
        "An SVG drawn onto a canvas through an image sees no web fonts and loads nothing from outside…",
        "Don’t make blob: URLs for pictures under a strict Content Security Policy (img-src 'self' data:)",
        "Lossless and arithmetic-coded JPEGs can’t go into a PDF as they are",
        "Adobe software stores CMYK JPEGs inverted",
        "Every value written into SVG must be escaped, attribute values too",
        "Tell a file by its first bytes, not its name",
        "Vite inlines small files (under 4 kB by default) as data"
      ],
      "card": "entries/file-io.json"
    },
    {
      "id": "fireworks",
      "aliases": [],
      "name": "Fireworks with real colour chemistry",
      "summary": "Shells launched by kind and colour to burst where you point: comets with sparkling tails, then peonies, chrysanthemums, willows, crossettes, palms, rings, hearts and more, their stars burning strontium red, barium green or copper blue and cooling along a blackbody curve, stepped on the GPU and mirrored in the water. A show sequencer, and a finale whose sparks steer into a word and pour gold rain.",
      "category": "particles",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "fireworks",
        "compute",
        "raw webgpu",
        "wgsl",
        "webgl2 fallback",
        "blackbody",
        "additive",
        "reflection",
        "particles",
        "sequencer"
      ],
      "useCases": [
        "celebrations and launch moments",
        "game victory screens",
        "new-season and event splashes",
        "night scenes over water",
        "a word written in light",
        "teaching colour and heat"
      ],
      "interaction": "Click or tap the sky to launch a shell there · Enter or Space launches one",
      "kits": [],
      "pairsWith": [
        {
          "id": "audience-vote",
          "why": "A burst on the winner’s reveal"
        },
        {
          "id": "audio-engine",
          "why": "Bangs and crackles on cue"
        },
        {
          "id": "cinematic-lens",
          "why": "Bloom on the stars"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [
        {
          "name": "calm",
          "in": "module",
          "values": {
            "strict": true,
            "refined": true,
            "playful": false
          },
          "note": "no strobing, glitter or crackle; softer bursts"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 6.538,
          "cpuMs": 0.13,
          "cpuP95Ms": 0.22,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the automatic show running at its defaults (about a shell a second, low quality): compute steps over the live shells’ slots, the backdrop, the sparks and their reflection, and the pass out, timed with timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 3.604,
          "cpuMs": 0.27,
          "cpuP95Ms": 0.435,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 667 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 6.894,
          "cpuMs": 0.26,
          "cpuP95Ms": 0.4,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 58 ms."
        }
      ],
      "signatures": [
        {
          "file": "fireworks-gl.ts",
          "declarations": "import { type Fireworks, type FireworksOptions } from './fireworks-core';\nexport declare function createFireworksGL(canvas: HTMLCanvasElement, options?: FireworksOptions): Promise<Fireworks | null>;"
        },
        {
          "file": "fireworks.ts",
          "declarations": "import { type Fireworks, type FireworksOptions } from './fireworks-core';\nexport type { ChemId, ShellKind, V3 } from './chemistry';\nexport { CHEMISTRY, SHELLS, SHELL_KINDS, COLOURFUL } from './chemistry';\nexport { FW_DT, SHOW_Z, flyComet, starReach } from './fireworks-core';\nexport type { Fireworks, FireworksOptions, LaunchOptions, WordOptions } from './fireworks-core';\nexport declare function requestFireworksDevice(): Promise<GPUDevice | null>;\nexport declare function createFireworks(device: GPUDevice, canvas: HTMLCanvasElement, options?: FireworksOptions): Promise<Fireworks>;"
        },
        {
          "file": "show.ts",
          "declarations": "import { type ChemId, type ShellKind } from './chemistry';\nimport type { Fireworks } from './fireworks';\nexport type Cue = {\n    t: number;\n    kind: ShellKind;\n    colour?: ChemId;\n    colour2?: ChemId;\n    u?: number;\n    v?: number;\n    z?: number;\n    calibre?: number;\n};\nexport type Show = {\n    density: number;\n    kind: ShellKind | 'mixed';\n    colour: ChemId | 'mixed';\n    paused: boolean;\n    update(dt: number): void;\n    play(cues: Cue[]): void;\n    finale(word?: string): number;\n    stop(): void;\n};\nexport declare function createShow(fw: Fireworks, options?: {\n    density?: number;\n    kind?: ShellKind | 'mixed';\n    colour?: ChemId | 'mixed';\n    seed?: number;\n}): Show;"
        }
      ],
      "pitfalls": [
        "A shell aims its comet on the CPU by stepping its flight exactly as the GPU will",
        "Gravity and wind are read at launch to aim",
        "Every slot of a block is drawn and stepped while the block is live, alive or not",
        "A full pool steals the block whose sparks go out soonest",
        "The sparks are HDR and additive",
        "Never queue more than one frame ahead",
        "The finale’s word needs half the pool (one block a shell, up to twelve)",
        "Without WebGPU use createFireworksGL",
        "Under reduced motion pass `calm`"
      ],
      "card": "entries/fireworks.json"
    },
    {
      "id": "fluid-fire",
      "aliases": [],
      "name": "Fire as a fluid",
      "summary": "Fire simulated as a fluid, not faked with sprites: a box of air over burning ground, stepped on the GPU every frame and drawn by marching each pixel’s ray through it. Each cell’s heat, smoke and velocity are traced back along the flow; hot air rises, smoke weighs it down, wind carries it and curl noise stirs it into folds; a pressure solve keeps the air from piling up, so rising air draws fresh air in at the sides. Heat and smoke are baked into a 3D texture, and the march glows deep red through orange to yellow-white, darkened by smoke and jittered per pixel so no slices show: one turbulent body of flame folding into dark smoke. Boxes for a campfire, a grass fire or a burning tree’s crown; burn() lights or douses the ground, and knobs set lift, folds, flame length, smoke and glow. three.js compute and TSL on WebGPU, the same step as full-screen passes into float render targets on WebGL2. The ray march is nearly all the cost: the demo’s campfire takes about 5 ms of GPU a frame at 1080p on a laptop RTX 4060 (0.2 ms of CPU), so lighter tiers halve the steps and march at half resolution for integrated GPUs and phones. Use it for one hero fire (a campfire, a brazier, a burning building, a cinematic close-up), not a world full of them.",
      "category": "simulation",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "expressive",
      "tags": [
        "fluid",
        "compute",
        "ray marching",
        "volumetric",
        "pressure solve",
        "storage 3d texture",
        "tsl",
        "render-target ping-pong",
        "webgl fallback"
      ],
      "useCases": [
        "campfires and braziers",
        "grass and brush fires",
        "burning buildings or vehicles",
        "smoke plumes",
        "cinematic close-ups"
      ],
      "interaction": "Drag to orbit round the fire",
      "kits": [],
      "pairsWith": [
        {
          "id": "heat-haze-shockwaves",
          "why": "Air that shimmers over the flames"
        },
        {
          "id": "plants-burn",
          "why": "Plants that catch from it"
        },
        {
          "id": "gpu-particles",
          "why": "Sparks and embers over the flames"
        }
      ],
      "variants": [],
      "version": "1.2.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "The fire marched in two thirds of the ray steps (52), a few pressure iterations fewer.",
          "low": "The fire marched at half the canvas each way in half the ray steps (40), one detail octave, fewer pressure iterations."
        },
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.80",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-03",
          "gpuMs": 5.054,
          "cpuMs": 0.23,
          "cpuP95Ms": 0.385,
          "badge": "heavy",
          "drawCalls": 6,
          "computeDispatches": 1,
          "frames": null,
          "notes": null
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 38.535,
          "cpuMs": 0.82,
          "cpuP95Ms": 1.13,
          "badge": "heavy",
          "drawCalls": 6,
          "computeDispatches": 1,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 258 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 5.503,
          "cpuMs": 0.06,
          "cpuP95Ms": 0.12,
          "badge": "heavy",
          "drawCalls": 7,
          "computeDispatches": 1,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 353 ms."
        }
      ],
      "signatures": [
        {
          "file": "compile-turn.ts",
          "declarations": "export declare function inTurn<T>(renderer: object, job: () => Promise<T>): Promise<T>;"
        },
        {
          "file": "fire.ts",
          "declarations": "import type * as THREE from 'three/webgpu';\nimport { FireVolume, type FireKnobs, type FireTier, type FireVolumeSettings } from './fire-volume';\nimport { FireVolumeGL } from './fire-volume-gl';\nexport type { FireTier } from './fire-volume';\nexport type FxQuality = 'game' | 'stage';\ntype Vec3 = [\n    number,\n    number,\n    number\n];\nexport type FireFrame = {\n    renderer: THREE.WebGPURenderer;\n    camera: THREE.Camera;\n    dt: number;\n    wind: THREE.Vector3;\n    hold?: boolean;\n};\nexport declare const STAGE_CAMPFIRE: FireVolumeSettings;\nexport type FireOptions = {\n    quality?: FxQuality;\n    tier?: FireTier;\n    box?: 'ground' | 'crown' | 'campfire' | FireVolumeSettings;\n    at?: Vec3;\n    radius?: number;\n    strength?: number;\n    knobs?: Partial<FireKnobs>;\n    renderer?: THREE.WebGPURenderer;\n};\nexport type FxFire = {\n    readonly volume: FireVolume | FireVolumeGL;\n    readonly object: THREE.Mesh;\n    update(frame: FireFrame): void;\n    settle(renderer: THREE.WebGPURenderer, seconds: number, wind?: THREE.Vector3): void;\n    dispose(): void;\n    burn(x: number, z: number, radius: number, strength?: number): void;\n    setKnobs(knobs: Partial<FireKnobs>): void;\n};\nexport declare function createFire(options?: FireOptions): FxFire;"
        }
      ],
      "pitfalls": [
        "Without WebGPU, pass `renderer` to `createFire` (or build `FireVolumeGL` yourself)",
        "Without the pressure solve the heat never leaves the bottom cells",
        "Jitter the ray march per pixel with interleaved gradient noise",
        "An orthographic camera needs parallel rays (the update checks the camera each frame)",
        "Compute pipelines are made on their first dispatch and the box’s draw on its first frame",
        "Fog lit the box’s whole volume until the fire premultiplied after the fog",
        "A volume writes no depth",
        "Stage quality is eight times the cells and twice the steps",
        "On a weak GPU pass `tier`",
        "A phone is far slower at the march than its other work"
      ],
      "card": "entries/fluid-fire.json"
    },
    {
      "id": "foam-treemap",
      "aliases": [],
      "name": "Foam treemap",
      "summary": "A treemap made of soap foam, where every bubble’s area is exactly its share. The GPU counts each cell’s area on a grid with atomics every frame and nudges its weight by a Newton step, so the power diagram’s areas match the shares to a fraction of a point; sites ease toward their centroids with a pull toward a home spot, so a bubble keeps its place as the numbers change. Small bubbles push harder (Laplace), so walls bend; three films meet in concave Plateau borders; each film shows real thin-film interference. DOM text blocks are rigid boxes the foam packs round, labels sit at each bubble’s roomiest point at the largest size that fits, and the what-ifs are physical: hold a bubble to blow it up, drag it onto another to merge (the wall breaks), double-click to pop. A CPU twin of the solver, tested, draws with Canvas 2D where WebGPU is missing.",
      "category": "data",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "treemap",
        "foam",
        "power diagram",
        "voronoi",
        "area exact",
        "atomics",
        "newton",
        "lloyd",
        "thin film",
        "iridescence",
        "plateau borders",
        "laplace",
        "labels",
        "what-if",
        "merge",
        "concentration",
        "hhi",
        "rigid text boxes",
        "raw webgpu",
        "wgsl",
        "compute",
        "canvas 2d fallback",
        "timestamp queries",
        "draw on demand",
        "no dependencies"
      ],
      "useCases": [
        "market shares, budgets or portfolios as one shape whose parts are exactly their sizes",
        "a treemap that keeps each item in its place over time, so change reads as growth, not as a shuffle",
        "what-ifs you do with your hands: grow a share, merge two, take one out, and see the rest yield",
        "a page where text and panels are part of the picture and the data packs round them",
        "a striking, calm hero or dashboard backdrop that is still a true chart"
      ],
      "interaction": "Hold a bubble to blow it up · drag it onto another to merge · double-click to pop · scrub the years · the list: arrows, + − and Delete",
      "kits": [
        {
          "kit": "dashboard",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "more-chart-types",
          "why": "The crisp treemap for strict views"
        },
        {
          "id": "chart-access",
          "why": "The shares as a table"
        },
        {
          "id": "data-table",
          "why": "The rows behind a bubble"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "The films drawn at 0.9× the pixels each way, at most 1.25 px per CSS px.",
          "low": "The films drawn at 0.8× the pixels each way, at most 1 px per CSS px."
        },
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "calm",
          "in": "module",
          "values": {
            "strict": true
          },
          "note": "the foam settles at once"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 4.968,
          "cpuMs": 0.33,
          "cpuP95Ms": 0.69,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.715,
            "p99Ms": 18.07,
            "low1Fps": 48.1
          },
          "notes": "Plays the ten years on a loop, so the solver re-packs every frame (twelve bubbles and the panel as a rigid box, 240 grid rows, 4 iterations a frame) and the foam is redrawn with its films flowing; GPU time from its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 12.845,
          "cpuMs": 0.495,
          "cpuP95Ms": 0.96,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 1883 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 10.514,
          "cpuMs": 0.72,
          "cpuP95Ms": 1.2,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 889 ms."
        }
      ],
      "signatures": [
        {
          "file": "foam-canvas.ts",
          "declarations": "import { type PackedCell } from './foam-cells';\nimport { type FoamEngine } from './foam';\nexport type CanvasFoamOptions = {\n    rows?: number;\n    iters?: number;\n    scale?: number;\n    calm?: boolean;\n};\nexport declare function createDrawField(packed: readonly PackedCell[], st: Float32Array, aspect: number): (px: number, py: number) => {\n    i: number;\n    j: number;\n    e1: number;\n    e2: number;\n};\nexport declare function createCanvasFoam(canvas: HTMLCanvasElement, options?: CanvasFoamOptions): FoamEngine | null;"
        },
        {
          "file": "foam-labels.ts",
          "declarations": "import { type LabelText } from './foam-model';\nimport type { FoamState } from './foam-solver';\nexport type LabelInfo = LabelText & {\n    tone?: 'up' | 'down' | '';\n    hide?: boolean;\n};\nexport type FoamLabels = {\n    update(states: readonly FoamState[] | null, info: (slot: number) => LabelInfo | null, dt: number): void;\n    dispose(): void;\n};\nexport declare function createFoamLabels(layer: HTMLElement, { calm }?: {\n    calm?: boolean | undefined;\n}): FoamLabels;"
        },
        {
          "file": "foam-model.ts",
          "declarations": "export type Vec2 = [\n    number,\n    number\n];\nexport declare function normalise(values: readonly number[]): number[];\nexport declare function setShare(shares: readonly number[], i: number, value: number, min?: number, max?: number): number[];\nexport declare function moveShare(shares: readonly number[], from: number, into: number, amount: number): number[];\nexport declare function releaseShare(shares: readonly number[], i: number, amount: number): number[];\nexport declare function hhi(shares: readonly number[], fringe?: (i: number) => boolean): number;\nexport declare const mergerDelta: (a: number, b: number) => number;\nexport declare function topShare(shares: readonly number[], n?: number, fringe?: (i: number) => boolean): number;\nexport declare function pressures(shares: readonly (number | null)[], lo?: number, hi?: number, power?: number): number[];\nexport declare function thicknessOf(change: number | null, full?: number, mid?: number, swing?: number): number;\nexport declare function follow(x: number, v: number, target: number, dt: number, stiffness?: number, damping?: number): {\n    x: number;\n    v: number;\n};\nexport type LabelText = {\n    name: string;\n    short?: string;\n    value: string;\n    note?: string;\n};\nexport type LabelSize = 'l' | 'm' | 's' | 'xs' | 'none';\nexport declare const LABEL_SIZES: ReadonlyArray<{\n    key: Exclude<LabelSize, 'none'>;\n    name: number;\n    value: number;\n    lines: number[];\n    note: boolean;\n    fit: number;\n}>;\nexport declare const textWidth: (text: string, px: number, em?: number) => number;\nexport declare function fitLabel(room: number, text: LabelText): LabelSize;\nexport declare const BOX_STEEP = 10000;\nexport declare function bubbleDistance(site: Vec2, weight: number, m: number, p: Vec2): number;\nexport declare function boxDistance(box: readonly number[], margin: number, p: Vec2): number;"
        },
        {
          "file": "foam.ts",
          "declarations": "import { type FoamCell, type FoamDomain, type PackedCell } from './foam-cells';\nimport { type FoamState } from './foam-solver';\nexport type FoamTier = 'high' | 'medium' | 'low';\nexport declare const FOAM_TIERS: Record<FoamTier, {\n    maxDpr: number;\n    renderScale: number;\n}>;\nexport type FoamOptions = {\n    device?: GPUDevice;\n    rows?: number;\n    iters?: number;\n    tier?: FoamTier;\n    maxDpr?: number;\n    renderScale?: number;\n    calm?: boolean;\n    onLost?(reason: string): void;\n};\nexport type FoamLook = {\n    theme?: 'dark' | 'light';\n    background?: [\n        number,\n        number,\n        number\n    ];\n    accent?: [\n        number,\n        number,\n        number\n    ];\n    wall?: number;\n    border?: number;\n};\nexport type FoamEngine = {\n    readonly tier: 'webgpu' | 'canvas2d';\n    readonly device: GPUDevice | null;\n    readonly maxCells: number;\n    resize(cssWidth: number, cssHeight: number, dpr?: number): void;\n    setDomain(domain: FoamDomain): void;\n    setCells(cells: readonly FoamCell[]): void;\n    setLook(look: FoamLook): void;\n    setQuality(rows: number, iters: number): void;\n    lightToward(x: number, y: number): void;\n    step(dt: number, options?: {\n        draw?: boolean;\n        time?: number;\n    }): boolean;\n    settle(frames?: number): Promise<void>;\n    readonly states: FoamState[] | null;\n    onState(callback: (states: FoamState[]) => void): () => void;\n    pick(x: number, y: number, exclude?: number): number;\n    error(): number;\n    settled(): boolean;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare function errorOf(cells: readonly PackedCell[], states: readonly FoamState[]): number;\nexport declare function fastest(cells: readonly PackedCell[], states: readonly FoamState[], scale: number): number;\nexport declare function gridFor(rows: number, aspect: number): {\n    gw: number;\n    gh: number;\n};\nexport declare function createFoam(canvas: HTMLCanvasElement, options?: FoamOptions): Promise<FoamEngine | null>;"
        }
      ],
      "pitfalls": [
        "Keep each thing in one slot",
        "A slot that goes from nothing to a share is born",
        "Areas are exact on the grid, not to the pixel",
        "Homes inside a rigid box are pushed out past the nearest box edge with room beyond it",
        "The true pole is packed into one 32-bit atomic",
        "The read-back is a frame or two behind",
        "Solver iterations are even",
        "A foam takes a while to stop",
        "A canvas that has given out a webgpu context cannot give a 2d one",
        "A device lost later (a driver reset, a laptop waking) stops the engine",
        "A cancelled pointer (pointercancel: the browser took the gesture) is not a drop",
        "The Canvas 2D tier keeps under about 3 ms a frame at 1072 × 576 by doing less",
        "The films are the cost, not the solver",
        "The foam is a picture: keep its numbers in the DOM too (a ranked list or a table)"
      ],
      "card": "entries/foam-treemap.json"
    },
    {
      "id": "foil-confetti",
      "aliases": [],
      "name": "Scrubbable foil confetti",
      "summary": "Metallic strips burst, tumble, flutter and settle on one analytic clock. Seek backwards or replay the same seeded burst without stepping a simulation. One instanced mesh, fixed reusable buffers, an optional studio reflection helper and a settled reduced-motion frame, on WebGPU and WebGL2.",
      "category": "particles",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "expressive",
      "tags": [
        "confetti",
        "foil",
        "celebration",
        "launch",
        "burst",
        "scrub",
        "replay",
        "seeded",
        "instancing",
        "metallic",
        "TSL",
        "reduced motion"
      ],
      "useCases": [
        "a product reveal or launch moment",
        "a milestone celebration that can be replayed",
        "a timeline-driven burst that scrubs in both directions",
        "lit foil without a compute simulation"
      ],
      "interaction": null,
      "kits": [],
      "pairsWith": [
        {
          "id": "keyframe-timeline",
          "why": "Drive seek(t) from an editable reveal timeline."
        },
        {
          "id": "camera-director",
          "why": "Frame the product while the burst stays anchored in world space."
        },
        {
          "id": "capability-tiers",
          "why": "Choose a smaller piece count for a weaker device."
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": "r187",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "count",
          "in": "module",
          "values": {
            "strict": 200,
            "refined": 900,
            "playful": 2600
          },
          "note": "The number of strips drawn from the preallocated capacity."
        },
        {
          "name": "flutter",
          "in": "module",
          "values": {
            "strict": 0.2,
            "refined": 0.5,
            "playful": 1.2
          },
          "note": "Sway amplitude while the foil falls."
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 0.066,
          "cpuMs": 0.175,
          "cpuP95Ms": 0.27,
          "badge": "light",
          "drawCalls": 2,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.285,
            "p99Ms": 6.695,
            "low1Fps": 144.9
          },
          "notes": "1600 seeded foil strips in one instanced draw, with a caller-driven six-second analytic burst, reusable attributes and a prefiltered room environment. Default bench constructs no product card or ground; it repeatedly seeks through the burst, without DOM updates."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "intel xe-2lpg",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Microsoft Edge 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 0.918,
          "cpuMs": 0.423,
          "cpuP95Ms": 0.605,
          "badge": "moderate",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Microsoft Edge 157, Chromium 157 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 522 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 2.049,
          "cpuMs": 0.22,
          "cpuP95Ms": 0.56,
          "badge": "heavy",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 534 ms."
        }
      ],
      "signatures": [
        {
          "file": "foil-confetti.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { type BurstOptions } from './burst';\nexport type FoilOptions = Partial<BurstOptions> & {\n    capacity?: number;\n    colours?: readonly THREE.ColorRepresentation[];\n    environment?: THREE.Texture | null;\n    reducedMotion?: boolean;\n};\nexport declare function createFoilConfetti(input?: FoilOptions): {\n    mesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.MeshStandardNodeMaterial, THREE.Object3DEventMap>;\n    capacity: number;\n    readonly time: number;\n    readonly duration: number;\n    readonly playing: boolean;\n    seek(t: number): void;\n    play(): void;\n    pause(): void;\n    update(dt: number): void;\n    setReducedMotion(value: boolean): void;\n    configure(next: Partial<BurstOptions> & {\n        colours?: readonly THREE.ColorRepresentation[];\n    }): void;\n    dispose(): void;\n};"
        },
        {
          "file": "studio-env.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nexport declare function createFoilStudio(renderer: THREE.WebGPURenderer): {\n    texture: THREE.CubeTexture<unknown>;\n    dispose(): void;\n};"
        }
      ],
      "pitfalls": [
        "Time is seconds in 0..duration. seek(t) pauses",
        "Capacity is fixed at construction (default at least 2600, maximum 10000)",
        "The anchor is a fixed world-space midpoint between two low cannon mouths",
        "Duration scales the whole trajectory to a chosen clip length, including landing",
        "Seeded input arrays are reproducible",
        "Supply a reflection environment for readable metal, or use createFoilStudio(renderer) once",
        "Reduced motion forces the settled end frame, including explicit play and seek calls",
        "No compute or storage-buffer feature is required",
        "Counts are not timings"
      ],
      "card": "entries/foil-confetti.json"
    },
    {
      "id": "forecast-delta",
      "aliases": [],
      "name": "A million futures as a river delta",
      "summary": "A Monte Carlo burndown drawn as land and water. A compute pass runs a million futures of a project (team speed with its weekly luck, new work found, holidays, risks that add work, slow the team or hold the launch), a batch a frame, and counts them with atomics into a weeks × work-left field (one count per family of risks) and into launch dates binned per combination of risks, so any deadline’s odds, percentiles and per-risk shares are read on the CPU without running anything again. The field becomes hills carved by rivers that reach a sea of launches, in a lit look and an engraved-chart look; drops run along real sample futures, and pointing pours a second stream from that spot (“if we are here then, when do we ship?”). One projective 3×3 maps the chart to the screen for the shader, a Canvas 2D fallback and a CSS matrix3d, so DOM words lie exactly on the tilted table; a field note wraps the river’s live bank with shape-outside polygons. The CPU replays any future bit for bit to check the GPU.",
      "category": "data",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "monte carlo",
        "forecast",
        "burndown",
        "project planning",
        "risk",
        "probability",
        "compute",
        "atomics",
        "webgpu",
        "raw webgpu",
        "homography",
        "matrix3d",
        "perspective",
        "shape-outside",
        "text wrap",
        "terrain",
        "flow",
        "cartography",
        "keyboard",
        "reduced motion",
        "canvas 2d fallback",
        "no dependencies"
      ],
      "useCases": [
        "release and delivery forecasts with honest odds",
        "what-if planning: people, scope and risk levers re-run live",
        "reading any deadline’s odds without re-running a simulation",
        "Monte Carlo results that keep every path visible",
        "DOM text laid exactly on a GPU-drawn tilted plane",
        "text that wraps a moving shape in a chart"
      ],
      "interaction": "Point at the land to pour futures from there · drag the deadline · change the plan beside the map · Table: drag to turn · Tab to the map, then the arrows",
      "kits": [
        {
          "kit": "dashboard",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "quiet-charts",
          "why": "The burndown as a plain chart beside it"
        },
        {
          "id": "chart-access",
          "why": "The futures as a table of percentiles"
        },
        {
          "id": "gauges-rings",
          "why": "The chance of making the date as a gauge"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "Half the futures a step, the run and the stream in turns; the land drawn at 0.85× the pixels.",
          "low": "262,144 futures a run, the run and the stream in turns; the land at 0.7× the pixels, the relief baked at half size, short shadows."
        },
        "reducedMotion": false
      },
      "toneKnobs": [
        {
          "name": "calm",
          "in": "module",
          "values": {
            "strict": true
          },
          "note": "held still: no clock, no drops"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-14",
          "gpuMs": 2.124,
          "cpuMs": 0.675,
          "cpuP95Ms": 0.955,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the plan changing every 2.5 s (a run of 1,048,576 futures, 32,768 a frame, with the field, coast and relief passes), a stream poured from a moving point, 1,100 drops and long hill shadows, flat chart, lit look."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 34.406,
          "cpuMs": 1.2,
          "cpuP95Ms": 2.055,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 860 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 10.185,
          "cpuMs": 2.76,
          "cpuP95Ms": 3.3,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 1297 ms."
        }
      ],
      "signatures": [
        {
          "file": "bank-wrap.ts",
          "declarations": "export type EdgeSide = 'left' | 'right';\nexport declare function edgeFloat(edge: (y: number) => number, height: number, side: EdgeSide, width: number, samples?: number): {\n    width: number;\n    height: number;\n    points: [\n        number,\n        number\n    ][];\n    polygon: string;\n};\nexport type EdgeWrap = {\n    layout(): number;\n    dispose(): void;\n};\nexport declare function wrapAlongEdge(block: HTMLElement, o: {\n    edge: (y: number) => number;\n    side: EdgeSide;\n    band?: number | (() => number);\n    samples?: number;\n    animate?: boolean;\n}): EdgeWrap;"
        },
        {
          "file": "forecast-delta.ts",
          "declarations": "import { type Arrivals, type MapSize, type Plan, type Start } from './model';\nimport { type Mat3 } from './homography';\nexport type DeltaLook = 'lit' | 'engraved';\nexport type DeltaTier = 'high' | 'medium' | 'low';\nexport declare const DELTA_TIERS: Record<DeltaTier, {\n    futures: number;\n    batch: number;\n    streamBatch: number;\n    streamFutures: number;\n    renderScale: number;\n    relief: number;\n    shadows: number;\n    alternate: boolean;\n}>;\nexport type DeltaOptions = {\n    canvas: HTMLCanvasElement;\n    device?: GPUDevice;\n    map?: MapSize;\n    tier?: DeltaTier;\n    futures?: number;\n    batch?: number;\n    streamBatch?: number;\n    streamFutures?: number;\n    renderScale?: number;\n    trajectories?: number;\n    seed?: number;\n    look?: DeltaLook;\n    before?: number;\n    calm?: boolean;\n    onLost?(reason: string): void;\n};\nexport type ForecastDelta = {\n    readonly device: GPUDevice;\n    readonly map: MapSize;\n    setPlan(P: Plan): void;\n    setFutures(n: number): void;\n    setDeadline(w: number): void;\n    setView(H: Mat3, opts?: {\n        clip?: [\n            number,\n            number,\n            number,\n            number\n        ];\n        sea?: number;\n    }): void;\n    setLook(look: DeltaLook, background?: [\n        number,\n        number,\n        number\n    ]): void;\n    setDrops(n: number): void;\n    setShadows(steps: number): void;\n    setCalm(calm: boolean): void;\n    streamFrom(start: Start | null): void;\n    onFigures(cb: ((a: Arrivals) => void) | null): void;\n    onStream(cb: ((a: Arrivals) => void) | null): void;\n    toCss(w: number, y: number): [\n        number,\n        number\n    ];\n    toChart(x: number, y: number): [\n        number,\n        number\n    ] | null;\n    resize(width: number, height: number, dpr: number): void;\n    frame(dt: number): boolean;\n    invalidate(): void;\n    wake(ms?: number): void;\n    progress(): {\n        count: number;\n        target: number;\n    };\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare function createForecastDelta(opts: DeltaOptions): Promise<ForecastDelta | null>;"
        },
        {
          "file": "homography.ts",
          "declarations": "export type Mat3 = number[];\nexport type Vec3 = [\n    number,\n    number,\n    number\n];\nexport declare function apply3(H: Mat3, x: number, y: number): [\n    number,\n    number\n];\nexport declare function depth3(H: Mat3, x: number, y: number): number;\nexport declare function inv3(m: Mat3): Mat3;\nexport declare function mul3(a: Mat3, b: Mat3): Mat3;\nexport declare function flatView(x0: number, coast: number, sx: number, sy: number): Mat3;\nexport type TablePlane = {\n    kx: number;\n    kz: number;\n    bx: number;\n    bz: number;\n};\nexport type TableCamera = {\n    yaw: number;\n    pitch: number;\n    dist: number;\n    target: Vec3;\n    focal: number;\n    centre: [\n        number,\n        number\n    ];\n};\nexport type TableView = {\n    H: Mat3;\n    pos: Vec3;\n    right: Vec3;\n    up: Vec3;\n    forward: Vec3;\n    focal: number;\n    centre: [\n        number,\n        number\n    ];\n};\nexport declare function tableView(cam: TableCamera, plane: TablePlane): TableView;\nexport declare function project(v: TableView, p: Vec3): [\n    number,\n    number\n] | null;\nexport declare function projectLifted(v: TableView, plane: TablePlane, w: number, y: number, lift: number): [\n    number,\n    number\n] | null;\nexport declare function domPlane(su: number, sv: number, top: number): Mat3;\nexport declare function cssMatrix3d(D: Mat3): string;"
        },
        {
          "file": "model.ts",
          "declarations": "export type MapSize = {\n    weeks: number;\n    points: number;\n};\nexport declare const MAP: MapSize;\nexport declare const GRID: {\n    readonly x: 1024;\n    readonly y: 512;\n};\nexport declare const LAGOON = 5;\nexport declare const MAX_RISKS = 4;\nexport declare const MAX_SLOW_WEEKS = 4;\nexport declare const MASKS: number;\nexport type Risk = {\n    id: string;\n    name: string;\n    kind: 'work' | 'slow' | 'stall';\n    p: number;\n    from: number;\n    to: number;\n    amount: number;\n};\nexport type Plan = {\n    backlog: number;\n    team: number;\n    add: number;\n    perPerson: number;\n    weekSd: number;\n    pathSd: number;\n    creep: number;\n    slowWeeks: Array<[\n        number,\n        number\n    ]>;\n    risks: Risk[];\n    deadline: number;\n};\nexport type Start = {\n    w: number;\n    y: number;\n};\nexport declare function pcg(v: number): number;\nexport declare function futureRng(index: number, seed: number): () => number;\nexport declare function teamSpeed(P: Plan, w: number): number;\nexport type Future = {\n    pts: Array<[\n        number,\n        number\n    ]>;\n    land: number;\n    mask: number;\n    family: number;\n};\nexport declare function future(P: Plan, index: number, seed?: number, start?: Start | null, map?: MapSize): Future;\nexport type Arrivals = {\n    count: number;\n    start: Start | null;\n    arrByMask: Uint32Array;\n    stats: Uint32Array;\n};\nexport declare function emptyArrivals(start?: Start | null): Arrivals;\nexport declare function countLaunch(a: Arrivals, land: number, mask: number, deadline: number, map?: MapSize): void;\nexport declare function futureCap(P: Pick<Plan, 'risks'> | null, map?: MapSize): number;\nexport type Scenario = {\n    mask: number;\n    n: number;\n    onTime: number;\n    land: number;\n};\nexport type Figures = {\n    count: number;\n    onTime: number;\n    p10: number;\n    p50: number;\n    p85: number;\n    scenarios: Scenario[];\n    perBin: Uint32Array;\n};\nexport declare function readArrivals(a: Arrivals, deadline: number, map?: MapSize): Figures;\nexport declare function launchedBy(F: Figures, w: number, map?: MapSize): number;\nexport type Family = {\n    family: number;\n    n: number;\n    share: number;\n    onTime: number;\n    land: number;\n};\nexport declare function families(F: Figures, nRisks?: number): {\n    families: Family[];\n    hit: number[];\n};\nexport declare function forecast(P: Plan, n: number, opts?: {\n    seed?: number;\n    start?: Start | null;\n    first?: number;\n    keep?: number;\n    map?: MapSize;\n}): {\n    arrivals: Arrivals;\n    runs: Future[];\n};\nexport declare function pathAt(pts: Array<[\n    number,\n    number\n]>, w: number): number | null;\nexport declare function riverBanks(runs: Future[], opts?: {\n    from?: number;\n    to?: number;\n    step?: number;\n    lo?: number;\n    hi?: number;\n    minShare?: number;\n    smooth?: number;\n}): {\n    from: number;\n    step: number;\n    lo: Float32Array<ArrayBuffer>;\n    hi: Float32Array<ArrayBuffer>;\n};\nexport type Banks = ReturnType<typeof riverBanks>;\nexport declare function bankAt(b: Banks, side: 'lo' | 'hi', w: number): number;\nexport type Feature = {\n    id: string;\n    name: string;\n    points: number;\n};\nexport type Mitigation = {\n    risk: string;\n    name: string;\n    p?: number;\n    amount?: number;\n};\nexport type Decisions = {\n    add: number;\n    cut: string[];\n    fix: string[];\n    deadline: number;\n};\nexport declare function planFor(base: Plan, d: Decisions, features: Feature[], mitigations: Mitigation[]): Plan;\nexport declare const dateOf: (start: number, w: number) => Date;\nexport declare function fmtDate(start: number, w: number, year?: boolean): string;\nexport declare function fmtLand(start: number, w: number, map?: MapSize): string;\nexport declare const pct: (x: number) => string;"
        }
      ],
      "pitfalls": [
        "The futures do not depend on the deadline",
        "Odds come from launch bins (1,024 along the map: a fifth of a day at 30 weeks)",
        "Arrivals are read back a frame or two late, and only one read per stream is out at a time",
        "Only the first two risks colour the water (four families: neither, one, the other, both)",
        "Up to four risks and four slow weeks",
        "The CPU replays future i exactly only in its random draws",
        "The table is flat on purpose",
        "CSS matrix3d divides by w as the shader does, but only where w is positive",
        "The table element sits at left 0, top 0 of the same box as the canvas, with transform-origin 0 0",
        "shape-outside needs a float with a size",
        "Memory: two streams of a 1,024 × 512 field (8 MB of counts each)",
        "While a run is counting, each frame costs a compute batch",
        "Timestamp queries need the timestamp-query feature",
        "On an integrated GPU pass tier",
        "A run holds at most futureCap(plan) futures"
      ],
      "card": "entries/forecast-delta.json"
    },
    {
      "id": "frame-meter",
      "aliases": [],
      "name": "On-page frame meter",
      "summary": "Labelled pass costs against a 16.7 ms frame budget, with separate CPU and GPU views, focusable details and a compact corner mode. Three.js inspector timestamps and raw WebGPU pass wrappers keep asynchronous GPU results paired with their CPU frame; missing queries stay unavailable.",
      "category": "ui",
      "role": "tooling",
      "stack": [
        "dom",
        "three",
        "webgpu"
      ],
      "character": "calm",
      "tags": [
        "performance",
        "frame budget",
        "CPU",
        "GPU",
        "timestamp queries",
        "profiling",
        "pass timing",
        "accessibility",
        "three.js",
        "webgpu",
        "webgl"
      ],
      "useCases": [
        "seeing which rendering pass spends the frame budget",
        "an in-app performance overlay with CPU fallback",
        "timing named three.js renders or raw WebGPU render and compute passes"
      ],
      "interaction": "Fill the field · add rings · spread the glow · open Details",
      "kits": [],
      "pairsWith": [
        {
          "id": "gpu-page-runtime",
          "why": "Shares the timestamp readback approach; use the meter with app-owned passes and devices"
        },
        {
          "id": "perf-gates",
          "why": "Observe live pass costs here; enforce repeatable performance thresholds with the test harness"
        },
        {
          "id": "dynamic-resolution",
          "why": "Inspect GPU pass costs before tuning the application’s resolution budget"
        }
      ],
      "variants": [],
      "version": "1.0.2",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "300 objects, two rings, eight blur steps; 1024 × 768 work targets",
          "low": "Starts at 180 objects, one ring, two blur steps; 512 × 384 work targets"
        },
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 0.309,
          "cpuMs": 0.355,
          "cpuP95Ms": 0.495,
          "badge": "light",
          "drawCalls": 63,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 4.132,
            "p99Ms": 7.66,
            "low1Fps": 127.1
          },
          "notes": "The meter itself, with the picture it times kept as light as the controls allow: 60 field meshes, no surface rings, one blur step and the final composite, at a fixed 1024×768 work resolution. The meter paints at 4 Hz. The in-use view measures the default picture (300 meshes, two rings, eight blur steps), which is the demo’s deliberate workload, not the meter’s cost."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "intel xe-2lpg",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Microsoft Edge 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 1.966,
          "cpuMs": 5.853,
          "cpuP95Ms": 6.79,
          "badge": "heavy",
          "drawCalls": 910,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Microsoft Edge 157, Chromium 157 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 2508 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 4.639,
          "cpuMs": 2.66,
          "cpuP95Ms": 3.22,
          "badge": "heavy",
          "drawCalls": 910,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 5174 ms."
        }
      ],
      "signatures": [
        {
          "file": "meter.ts",
          "declarations": "import { type FrameSample, type Metric } from './slices';\nimport './meter.css';\nexport declare function createFrameMeter(parent: HTMLElement, options?: {\n    budget?: number;\n    compact?: boolean;\n    metric?: Metric;\n}): {\n    element: HTMLElement;\n    setCompact: (compact: boolean) => void;\n    update(next: FrameSample): void;\n    dispose(): void;\n};"
        },
        {
          "file": "raw-timer.ts",
          "declarations": "import type { FrameSample } from './slices';\nexport declare function createRawTimer(device: GPUDevice, capacity?: number): {\n    beginFrame: (commandEncoder: GPUCommandEncoder) => void;\n    beginRenderPass: (name: string, descriptor: GPURenderPassDescriptor) => GPURenderPassEncoder;\n    beginComputePass: (name: string, descriptor?: GPUComputePassDescriptor) => GPUComputePassEncoder;\n    endPass: (pass: GPURenderPassEncoder | GPUComputePassEncoder) => void;\n    endFrame: () => void;\n    afterSubmit: () => Promise<FrameSample | null>;\n    dispose: () => void;\n    supported: boolean;\n};"
        },
        {
          "file": "three-timer.ts",
          "declarations": "import type { WebGPURenderer } from 'three/webgpu';\nimport type { WebGLRenderer } from 'three';\nimport { type FrameSample } from './slices';\nexport declare function createThreeTimer(renderer: WebGPURenderer | WebGLRenderer): {\n    beginFrame: () => void;\n    measure: <T>(name: string, draw: () => T) => T;\n    endFrame: () => Promise<FrameSample | null>;\n    dispose: () => void;\n    supported: boolean;\n};"
        }
      ],
      "pitfalls": [
        "CPU and GPU overlap: never add them",
        "Use unique names and disjoint synchronous scopes",
        "Three.js integration is checked against r187",
        "Raw WebGPU needs timestamp-query enabled when requesting the device",
        "One readback is in flight at a time",
        "Dispose adapters and the meter on teardown",
        "Live demo timing includes the workload and measurement overhead"
      ],
      "card": "entries/frame-meter.json"
    },
    {
      "id": "game-cameras",
      "aliases": [],
      "name": "Game cameras",
      "summary": "The third-person cameras of a game that “feels great”: over the shoulder with mouse look, an arm of two ball casts that pulls in at once when something comes between and eases back out when the way clears, a shoulder swap that glides across, a narrower view for aiming and a wider one for running, and a pivot that lags in height so steps never jolt. The driving camera turns the same orbit about the vehicle with no switch, drifting back behind it while it moves, drawing back and widening with speed, kicked by hits and dipped by hard landings. The physics engine’s cast becomes a callback; a plain three.js set of boxes and balls stands in for one. A top view over the player completes the set: it leans ahead of where you are going (further in a car) and never sweeps faster than a set rate, rides steps on a spring, closes in indoors, takes the storeys above you off the building you are in, and opens a dithered window through walls and roofs that stand between the camera and you.",
      "category": "technique",
      "role": "system",
      "stack": [
        "three",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "camera",
        "third person",
        "over the shoulder",
        "spring arm",
        "camera collision",
        "sphere cast",
        "shape cast",
        "shoulder swap",
        "aim",
        "field of view",
        "chase camera",
        "driving camera",
        "orbit",
        "pointer lock",
        "mouse look",
        "touch",
        "virtual stick",
        "camera shake",
        "frame-rate independent",
        "reduced motion",
        "top-down camera",
        "isometric",
        "lookahead",
        "camera lead",
        "cutaway",
        "cutout",
        "x-ray",
        "see-through walls",
        "occlusion",
        "dither",
        "tsl",
        "three.js",
        "no dependencies"
      ],
      "useCases": [
        "third-person action and adventure games",
        "over-the-shoulder aiming",
        "a driving or riding camera that hands over from on foot",
        "walking through an architectural model or a level",
        "keeping a follow camera out of walls without a physics engine",
        "a playable character in a product or brand world",
        "testing a level’s tight spots for the camera",
        "a top-down or isometric game where buildings must never hide the player",
        "walking into a building and seeing the floor you are on",
        "a camera that shows more of where you are heading"
      ],
      "interaction": "Click to capture the mouse (Esc lets go) · W A S D walk · V swap shoulder · F or right button aim · E drive · T top view",
      "kits": [
        {
          "kit": "game",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "play-input",
          "why": "Mouse look, sticks and touch drive it"
        },
        {
          "id": "humanoid-rig",
          "why": "The figure it follows over the shoulder"
        },
        {
          "id": "race-car",
          "why": "Chase cameras for the car"
        }
      ],
      "variants": [],
      "version": "1.0.3",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 0.415,
          "cpuMs": 0.885,
          "cpuP95Ms": 1.36,
          "badge": "moderate",
          "drawCalls": 74,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured walking by itself round a loop (through the low arch, under the colonnade roof, past the ball), the view turning and tilting so the arm is pulled in and eases out; the cast view on. Both casts run against about 40 boxes and a ball each frame (microseconds). Standing still, nothing is drawn at all."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 2.556,
          "cpuMs": 2.34,
          "cpuP95Ms": 3.135,
          "badge": "heavy",
          "drawCalls": 89,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 559 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 1.878,
          "cpuMs": 0.38,
          "cpuP95Ms": 0.52,
          "badge": "moderate",
          "drawCalls": 104,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 838 ms."
        }
      ],
      "signatures": [
        {
          "file": "chase.ts",
          "declarations": "import { Vector3, type PerspectiveCamera } from 'three';\nexport interface ChaseTarget {\n    x: number;\n    y: number;\n    z: number;\n    heading: number;\n    speed: number;\n    vx: number;\n    vz: number;\n    grounded: boolean;\n}\nexport interface Orbit {\n    yaw: number;\n    pitch: number;\n}\nexport declare const CHASE: {\n    alignAfter: number;\n    alignRate: number;\n    pitch: number;\n    distance: number;\n    distanceAtSpeed: number;\n    centreUp: number;\n    fov: number;\n    fovAtSpeed: number;\n    feelSpeed: number;\n};\nexport type ChaseTuning = typeof CHASE;\nexport declare class ChaseCamera {\n    shakeOut: number;\n    speedRatio: number;\n    reducedMotion: boolean;\n    readonly tune: ChaseTuning;\n    constructor(tuning?: Partial<ChaseTuning>);\n    touched(): void;\n    reset(): void;\n    impact(nx: number, nz: number, speed: number): void;\n    update(camera: PerspectiveCamera, orbit: Orbit, c: ChaseTarget, dt: number, clip: (from: Vector3, to: Vector3) => number, groundAt?: (x: number, z: number) => number): void;\n}\nexport declare function wrap(a: number): number;"
        },
        {
          "file": "colliders.ts",
          "declarations": "import { Quaternion, Vector3, type Object3D } from 'three';\nimport { type SphereCast } from './sweep';\nexport type Collider = {\n    readonly kind: 'box' | 'ball';\n    readonly center: Vector3;\n    readonly half: Vector3;\n    readonly rotation: Quaternion;\n    radius: number;\n    enabled: boolean;\n    tag?: unknown;\n    readonly object?: Object3D;\n    live: boolean;\n    place(center: Vector3, rotation?: Quaternion): void;\n};\nexport type ColliderOptions = {\n    tag?: unknown;\n    enabled?: boolean;\n};\nexport type SegmentClip = (from: Vector3, to: Vector3) => number;\nexport type Colliders = {\n    readonly list: readonly Collider[];\n    readonly lastHit: Collider | null;\n    addBox(center: Vector3, size: Vector3, rotation?: Quaternion | number, options?: ColliderOptions): Collider;\n    addBall(center: Vector3, radius: number, options?: ColliderOptions): Collider;\n    addObject(object: Object3D, options?: ColliderOptions & {\n        shape?: 'box' | 'ball';\n        live?: boolean;\n    }): Collider;\n    remove(collider: Collider): void;\n    cast(from: Vector3, dir: Vector3, max: number, radius: number, skip?: (c: Collider) => boolean): number | null;\n    caster(skip?: (c: Collider) => boolean): SphereCast<Vector3>;\n    clip(radius?: number, skip?: (c: Collider) => boolean): SegmentClip;\n    clear(): void;\n    dispose(): void;\n};\nexport declare function createColliders(): Colliders;"
        },
        {
          "file": "cutout-nodes.ts",
          "declarations": "import * as THREE from 'three/webgpu';\ntype Any = any;\nexport declare const CUT_CAP: THREE.Color;\nexport declare const UNCUT = 1000000000;\nexport type Cutout = {\n    focus: Any;\n    radius: Any;\n    open: Any;\n    fade: Any;\n    nearFade: Any;\n    active: Any;\n};\nexport declare function createCutout(): Cutout;\nexport declare function updateCutout(cutout: Cutout, feet: {\n    x: number;\n    y: number;\n    z: number;\n}, chest?: number): void;\nexport declare const OPENING_CONE = 1;\nexport declare const PROP_VIEW_OPENING = 1.4;\nexport declare function viewOpening(cutout: Cutout, world: Any, radius: Any): any;\nexport declare function applyViewOpening(material: THREE.NodeMaterial, cutout: Cutout, radius?: number): void;\nexport declare function applyCutout(material: THREE.NodeMaterial, cutout: Cutout, options?: {\n    capBackFaces?: boolean;\n    perInstance?: boolean;\n    uncut?: boolean;\n}): void;\nexport {};"
        },
        {
          "file": "cutout.ts",
          "declarations": "export type Ring = ReadonlyArray<{\n    x: number;\n    z: number;\n}>;\nexport type CutBuilding = {\n    key: string;\n    ring: Ring;\n    base: number;\n    top: number;\n    storeys: number;\n    storeyHeight: number;\n    eaves?: Ring;\n    wallTop?: number;\n};\nexport type Cut = {\n    cutY: number;\n};\nexport declare const STUB = 1.5;\nexport declare function insideRing(ring: Ring, x: number, z: number): boolean;\nexport declare function ringGap(a: Ring, b: Ring): number;\nexport declare function buildingOf(buildings: readonly CutBuilding[], at: {\n    x: number;\n    y: number;\n    z: number;\n}): CutBuilding | null;\nexport declare function floorAt(building: CutBuilding, y: number): number;\nexport declare function buildingAt(buildings: readonly CutBuilding[], at: {\n    x: number;\n    y: number;\n    z: number;\n}): CutBuilding | null;\ntype P3 = {\n    x: number;\n    y: number;\n    z: number;\n};\nexport declare function blocksSight(building: CutBuilding, from: P3, to: P3): boolean;\nexport declare function hiders(buildings: readonly CutBuilding[], chest: P3, toCamera: P3, skip?: CutBuilding | null, reach?: number): Set<string>;\nexport declare function hidden(buildings: readonly CutBuilding[], chest: P3, toCamera: P3): boolean;\nexport declare function cutTargets(buildings: readonly CutBuilding[], player: P3): {\n    targets: Map<string, Cut>;\n    home: CutBuilding | null;\n    ceiling: number;\n};\nexport declare class CutState {\n    step(buildings: readonly CutBuilding[], targets: ReadonlyMap<string, Cut>, dt: number): Map<string, Cut>;\n}\nexport {};"
        },
        {
          "file": "look-input.ts",
          "declarations": "export type LookInputOptions = {\n    look(dx: number, dy: number): void;\n    wheel?(deltaY: number): void;\n    lock?: boolean;\n    dragScale?: {\n        touch?: number;\n        mouse?: number;\n    };\n    ignore?(target: Element): boolean;\n    onLock?(locked: boolean): void;\n    onRefused?(): void;\n};\nexport type LookInput = {\n    readonly locked: boolean;\n    release(): void;\n    dispose(): void;\n};\nexport declare function attachLookInput(el: HTMLElement, options: LookInputOptions): LookInput;"
        },
        {
          "file": "overhead.ts",
          "declarations": "import { Vector3, type PerspectiveCamera } from 'three';\nimport { type LookaheadMode } from './lookahead';\nexport declare const OVERHEAD: {\n    down: number;\n    fov: number;\n    span: number;\n    focusHeight: number;\n    followDamping: number;\n    heightDamping: number;\n    indoorZoom: number;\n    indoorRate: number;\n};\nexport type OverheadTuning = typeof OVERHEAD;\nexport declare class OverheadCamera {\n    readonly tune: OverheadTuning;\n    yaw: number;\n    strength: number;\n    mode: LookaheadMode;\n    indoors: boolean;\n    readonly lean: import(\"./lookahead\").LookaheadState;\n    readonly target: Vector3;\n    zoom: number;\n    constructor(tuning?: Partial<OverheadTuning>);\n    reset(): void;\n    recentre(): void;\n    update(camera: PerspectiveCamera, focus: {\n        x: number;\n        y: number;\n        z: number;\n    }, dt: number): void;\n}"
        },
        {
          "file": "shake.ts",
          "declarations": "import type { PerspectiveCamera } from 'three';\nexport declare class CameraShake {\n    amount: number;\n    add(kick: number, cap?: number): void;\n    apply(camera: PerspectiveCamera, dt: number, time: number): boolean;\n}"
        },
        {
          "file": "third-person.ts",
          "declarations": "import { Vector3, type PerspectiveCamera } from 'three';\nimport type { SphereCast } from './sweep';\nexport declare const THIRD_PERSON: {\n    sensitivity: number;\n    pitchMin: number;\n    pitchMax: number;\n    pivotStand: number;\n    pivotCrouch: number;\n    shoulder: number;\n    shoulderAim: number;\n    distance: number;\n    distanceMin: number;\n    distanceMax: number;\n    distanceAim: number;\n    distanceRun: number;\n    fov: number;\n    fovRun: number;\n    fovAim: number;\n    probe: number;\n    easeOut: number;\n    heightLag: number;\n    skin: number;\n};\nexport type ThirdPersonTuning = typeof THIRD_PERSON;\nexport type ArmCasts = {\n    head: Vector3;\n    pivot: Vector3;\n    want: Vector3;\n    end: Vector3;\n    sideWant: number;\n    sideFree: number;\n    backWant: number;\n    backFree: number;\n    arm: number;\n};\nexport declare class ThirdPersonCamera {\n    readonly camera: PerspectiveCamera;\n    yaw: number;\n    pitch: number;\n    zoom: number;\n    side: number;\n    aiming: boolean;\n    running: boolean;\n    reducedMotion: boolean;\n    sensitivityScale: number;\n    closeness: number;\n    readonly tune: ThirdPersonTuning;\n    readonly casts: ArmCasts;\n    constructor(camera: PerspectiveCamera, cast: SphereCast<Vector3>, tuning?: Partial<ThirdPersonTuning>);\n    look(dx: number, dy: number): void;\n    wheel(deltaY: number): void;\n    forwardFlat(out: Vector3): Vector3;\n    rightFlat(out: Vector3): Vector3;\n    reset(): void;\n    update(feet: Vector3, crouched: boolean, dt: number): void;\n    aimRay(origin: Vector3, direction: Vector3): void;\n}"
        }
      ],
      "pitfalls": [
        "Leave the player’s own body out of the cast (and the car while driving it)",
        "Run the camera after the movement, on the drawn (interpolated) position",
        "The arm pulls in at once and only eases outward",
        "The first cast (head to shoulder pivot) matters as much as the arm",
        "Keep `skin` and the near plane together",
        "The height lag is capped at 1.5 m",
        "One orbit for both cameras",
        "The chase camera drifts behind only while the vehicle moves faster than 2.5 m/s",
        "Its clip is a segment test from the orbit’s centre to the camera (a ray in the game)",
        "Add shakeOut to your own shake each frame and apply the shake after both cameras have placed…",
        "The colliders here are a stand-in for small scenes",
        "Mouse look moves are in pixels",
        "Pointer lock needs a user gesture and can be refused (embedded frames, some hosts)",
        "The top view’s lean follows the drawn focus each frame and treats a jump of more than 30 m as a…",
        "The lean is in world metres on the ground, not on screen",
        "The cutaway is a mask (alpha-tested discard), not transparency",
        "Each building mesh reads its cut from `userData.cutY` as it is drawn (a per-object uniform)",
        "Back faces are drawn only as a flat cap where a wall is cut",
        "The window through buildings needs `open` eased (the demo at 14 a second)",
        "hiders() tests prisms against the chest-to-camera segment",
        "The cut rises with the feet on a stair (it never drops below them)",
        "The props’ opening (`applyViewOpening`) depends on where each fragment is relative to the…"
      ],
      "card": "entries/game-cameras.json"
    },
    {
      "id": "gauges-rings",
      "aliases": [],
      "name": "Gauges and progress rings",
      "summary": "Instrument gauges in SVG (a tach with a red line on a nice scale, a speedometer with a best mark, a fuel gauge and an LED ring) whose needles chase their values on a spring, and progress rings four ways: an ensō brush stroke, a glass of sloshing liquid, a plain arc, and a segmented ring with a turning notched rim, a sweep round its lit segments and an inner ring per tier reached that draws itself in. Accessible meters, themed with CSS variables, any size.",
      "category": "data",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "svg",
        "gauges",
        "progress",
        "dashboard",
        "springs",
        "animation",
        "segmented ring",
        "tiers",
        "hud",
        "accessibility",
        "intl",
        "no dependencies"
      ],
      "useCases": [
        "dashboards and KPI tiles",
        "progress toward a goal or rank",
        "downloads, uploads and installs",
        "games and racing HUDs",
        "device and IoT panels",
        "fitness and quotas",
        "levels, tiers and streaks round one number"
      ],
      "interaction": "A simulated drive and download run live · Pause and use the Speed slider · move the red line",
      "kits": [
        {
          "kit": "dashboard",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "quiet-charts",
          "why": "Plain charts beside the gauges"
        },
        {
          "id": "race-car",
          "why": "A tach and speedometer for the car"
        },
        {
          "id": "loading-states",
          "why": "Progress rings while a view loads"
        }
      ],
      "variants": [],
      "version": "1.0.2",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0.355,
          "cpuP95Ms": 0.675,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the simulated drive and the download running: four needles on their springs and three rings, one of them a liquid that moves every frame. Each frame writes a needle angle, the sweep’s mask, any LED segments that change and the ensō’s stroke while it grows."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.548,
          "cpuP95Ms": 1.01,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 103 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.52,
          "cpuP95Ms": 1.54,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 64 ms."
        }
      ],
      "signatures": [
        {
          "file": "gauges.ts",
          "declarations": "import { type Spring } from './core';\nexport { niceTicks, tachSpec, NEEDLE, type Spring, type TachScale } from './core';\nexport type GaugeKind = 'tach' | 'speed' | 'fuel' | 'led';\nexport type Mark = {\n    at: number;\n    label: string;\n    tone?: 'red' | 'best' | 'strong';\n};\nexport type GaugeOptions = {\n    kind: GaugeKind;\n    label: string;\n    min?: number;\n    max?: number;\n    value?: number;\n    ticks?: number;\n    minors?: number;\n    red?: number | null;\n    best?: number | null;\n    target?: number;\n    low?: number;\n    segments?: number;\n    marks?: Mark[] | false;\n    markFormat?: (v: number) => string;\n    format?: (v: number) => string;\n    unit?: string;\n    readout?: 'center' | 'bottom' | false;\n    spring?: Partial<Spring>;\n    loop?: boolean;\n};\nexport type Gauge = {\n    readonly el: HTMLElement;\n    readonly center: HTMLElement;\n    readonly value: number;\n    readonly shown: number;\n    set(value: number): void;\n    update(options: Partial<Omit<GaugeOptions, 'kind'>>): void;\n    sweep(kick?: number): void;\n    step(dt: number): boolean;\n    dispose(): void;\n};\nexport declare function gauge(host: HTMLElement, options: GaugeOptions): Gauge;"
        },
        {
          "file": "rings.ts",
          "declarations": "export type RingStyle = 'enso' | 'liquid' | 'plain' | 'segments';\nexport type RingOptions = {\n    style: RingStyle;\n    label: string;\n    value?: number;\n    format?: (fraction: number) => string;\n    caption?: string;\n    wave?: boolean;\n    loop?: boolean;\n    segments?: number;\n    tiers?: number;\n};\nexport type Ring = {\n    readonly el: HTMLElement;\n    readonly center: HTMLElement;\n    readonly value: number;\n    set(fraction: number): void;\n    update(options: Partial<Omit<RingOptions, 'style'>>): void;\n    step(dt: number): boolean;\n    dispose(): void;\n};\nexport declare function progressRing(host: HTMLElement, options: RingOptions): Ring;"
        }
      ],
      "pitfalls": [
        "Pick a max that divides into the ticks",
        "The labels are DOM, sized in container units of the gauge",
        "Each gauge on its own loop (the default) sleeps once its needle settles",
        "A liquid ring animates every frame while it is on screen",
        "The red zone blinks 2.5 times a second while the needle is in it",
        "aria-valuenow and the readout follow `set()`, not the needle",
        "The segmented ring turns by CSS animations on SVG groups",
        "The segmented ring pulses only when its value moves by a segment or more in one `set`",
        "At most four tier rings fit between the segments and the number (`MAX_TIERS`)",
        "Under prefers-reduced-motion the needles jump to their value, the glint, blink and waves stop",
        "Theme with --gr-accent, --gr-red, --gr-best, --gr-liquid and friends on any parent",
        "Import gauges.base.css before gauges.css"
      ],
      "card": "entries/gauges-rings.json"
    },
    {
      "id": "glass-engraving",
      "aliases": [],
      "name": "Glass engraving",
      "summary": "Laser engraving inside a block of glass: any word or mask becomes a cloud of tiny fractures, written by the laser layer by layer from the bottom up, seen through the refracting block with its mirror images in the walls and a rainbow on the bevels. WebGPU compute splats the points; the studio is ray-traced through the glass, each colour its own way.",
      "category": "surface",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "glass",
        "refraction",
        "dispersion",
        "total internal reflection",
        "point cloud",
        "laser",
        "wgsl",
        "raw webgpu",
        "compute",
        "ray tracing"
      ],
      "useCases": [
        "awards, trophies and keepsakes in a configurator",
        "product shots and hero sections",
        "title cards and splash screens",
        "loading moments with a progress to show",
        "museum and exhibition pieces"
      ],
      "interaction": "Drag or use the arrow keys to turn the block · Enter to engrave again",
      "kits": [],
      "pairsWith": [
        {
          "id": "fibre-light",
          "why": "The same word written in light"
        },
        {
          "id": "circuit-from-text",
          "why": "The same word as a circuit board"
        },
        {
          "id": "laser-cutting",
          "why": "The same laser, cutting steel"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 3.598,
          "cpuMs": 0.195,
          "cpuP95Ms": 0.29,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "The block turning at 9°/s while the word is engraved over and over (low quality, 60k points): the points and their mirror images splatted in one compute pass, the studio traced through the glass with dispersion, one composite pass; timed with its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 4.391,
          "cpuMs": 0.385,
          "cpuP95Ms": 0.535,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 849 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 1.888,
          "cpuMs": 0.56,
          "cpuP95Ms": 0.68,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 127 ms."
        }
      ],
      "signatures": [
        {
          "file": "cloud.ts",
          "declarations": "import type { Mask } from './mask';\nimport { type Field } from './shape';\nexport type CloudOptions = {\n    points?: number;\n    height?: number;\n    maxWidth?: number;\n    depth?: number;\n    seed?: number;\n};\nexport declare const RASTER: {\n    readonly layer: 0.00022;\n    readonly row: 0.0003;\n};\nexport declare const SHARES: {\n    readonly wall: 0.42;\n    readonly face: 0.22;\n    readonly fill: 0.36;\n};\nexport type Cloud = {\n    pts: Float32Array;\n    count: number;\n    box: {\n        x0: number;\n        y0: number;\n        x1: number;\n        y1: number;\n        depth: number;\n    };\n    spacing: {\n        wall: number;\n        face: number;\n        fill: number;\n    };\n};\nexport declare function pcgRandom(seed: number): () => number;\nexport declare function signedDistance(f: Field): Float32Array;\nexport declare function cloudOf(mask: Mask, { points, height, maxWidth, depth, seed }?: CloudOptions): Cloud;\nexport declare function writtenBy(c: Pick<Cloud, 'pts' | 'count'>, progress: number): number;"
        },
        {
          "file": "engraving.ts",
          "declarations": "import { type Cloud } from './cloud';\nimport { GLASSES } from './optics';\nexport type Quality = 'low' | 'medium' | 'high';\nexport declare const QUALITY: Record<Quality, {\n    scene: number;\n    order: number;\n    bounces: number;\n    edges: boolean;\n}>;\nexport type EngraveView = {\n    progress: number;\n    yaw?: number;\n    tilt?: number;\n    dispersion?: number;\n    light?: number;\n    haze?: number;\n    zoom?: number;\n    exposure?: number;\n};\nexport type EngravingColours = {\n    led: string;\n    laser: string;\n    flash: string;\n    ink: string;\n    studio: string;\n};\nexport type EngravingOptions = {\n    device?: GPUDevice;\n    quality?: Quality;\n    glass?: keyof typeof GLASSES;\n    colours?: Partial<EngravingColours>;\n};\nexport type GlassEngraving = {\n    readonly device: GPUDevice;\n    setCloud(cloud: Cloud): void;\n    setQuality(quality: Quality): void;\n    setColours(colours: Partial<EngravingColours>): void;\n    draw(view: EngraveView): void;\n    readonly busy: boolean;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare function createGlassEngraving(canvas: HTMLCanvasElement, options?: EngravingOptions): Promise<GlassEngraving | null>;"
        },
        {
          "file": "mask.ts",
          "declarations": "export type Mask = {\n    data: Uint8Array;\n    w: number;\n    h: number;\n    cap: number;\n    foot: number;\n};\nexport type TextMaskOptions = {\n    px?: number;\n    family?: string;\n    weight?: number | string;\n    spacing?: number;\n};\nexport declare function textMask(text: string, { px, family, weight, spacing }?: TextMaskOptions): Mask;\nexport declare function drawnMask(w: number, h: number, draw: (g: CanvasRenderingContext2D) => void): Mask;"
        },
        {
          "file": "still.ts",
          "declarations": "import type { Mask } from './mask';\nexport declare function drawEngravingStill(g: CanvasRenderingContext2D, mask: Mask, { light, glow, ink, backdrop }?: {\n    light?: number | undefined;\n    glow?: string | undefined;\n    ink?: string | undefined;\n    backdrop?: string | undefined;\n}): void;"
        }
      ],
      "pitfalls": [
        "The points’ picture is a storage buffer of three u32s a pixel at the canvas’s full size",
        "Draw at the canvas’s own width and height",
        "Building a cloud is CPU work (a distance transform and a sort: about 50–150 ms for 120k points)",
        "A long word is scaled down to fit maxWidth (20 cm)",
        "The flashes are timed from how fast progress moves",
        "Only the walls’ strong (total internal) reflections are drawn as images",
        "Without WebGPU createGlassEngraving returns null"
      ],
      "card": "entries/glass-engraving.json"
    },
    {
      "id": "gltf-motion",
      "aliases": [],
      "name": "glTF models with recorded motion",
      "summary": "GLB models ready for a stage: gated before loading (header, size and count budgets, allowed extensions, nothing outside the file, each refusal with a plain reason) and measured (size, triangles, which decoders it needs), loaded once and copied, scaled to a known size and stood on the ground, instanced by the hundred, warmed up unseen. Motion plays as a function of show time: the file’s own clips through the AnimationMixer, and recorded transform tracks, captured at a fixed rate from anything code moves live (suspension, a gait, a crane) and played back at any Effect speed, looped seamlessly or once.",
      "category": "technique",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "calm",
      "tags": [
        "gltf",
        "glb",
        "GLTFLoader",
        "AnimationMixer",
        "animation clips",
        "motion capture",
        "recorded tracks",
        "seamless loop",
        "instancing",
        "crowd",
        "normalise",
        "bounds",
        "meshopt",
        "ktx2",
        "warm-up",
        "validation",
        "upload",
        "untrusted files",
        "deterministic",
        "effect speed",
        "three"
      ],
      "useCases": [
        "vehicles and machines on a live stage, replaying motion a game made",
        "a convoy, a crowd or a field of machines from one model",
        "scrubbing or replaying a show and getting the same frame",
        "turning a simulation into a small file that needs no simulation to play",
        "checking models (size, decoders) before a show loads them",
        "accepting a GLB someone uploads or picks, refused with a reason they can act on before any loader runs",
        "models from any tool in any unit, shown at the size you want"
      ],
      "interaction": "Record a lap live and watch the convoy replay it · drag to orbit · Gate: pick a broken file to see why it is refused",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        },
        {
          "kit": "product-presentation",
          "as": "core"
        },
        {
          "kit": "shop",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "compile-without-stalls",
          "why": "Warm the model’s materials before showing it"
        },
        {
          "id": "segment-loader",
          "why": "Load and release models under a byte budget"
        },
        {
          "id": "crowd-bake",
          "why": "Bake its clips for crowds"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [
          "three/addons GLTFLoader and SkeletonUtils"
        ],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 1.02,
          "cpuMs": 0.415,
          "cpuP95Ms": 0.58,
          "badge": "moderate",
          "drawCalls": 67,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Playback: the rover and a convoy of 20 copies replaying a recorded lap (six nodes at 30 Hz) and two clips baked from the GLB; the convoy is 15 instanced meshes, its matrices composed on the CPU each frame. The lap is recorded time-compressed at load. Shadows on."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 3.801,
          "cpuMs": 1.645,
          "cpuP95Ms": 2.225,
          "badge": "heavy",
          "drawCalls": 67,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 717 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 2.626,
          "cpuMs": 0.5,
          "cpuP95Ms": 1.16,
          "badge": "heavy",
          "drawCalls": 67,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 968 ms."
        }
      ],
      "signatures": [
        {
          "file": "clip-player.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { MotionTrack } from './motion-track';\nexport type ClipPlayOptions = {\n    loop?: boolean;\n    fade?: number;\n    weight?: number;\n    offset?: number;\n};\nexport type ClipPlayer = {\n    readonly mixer: THREE.AnimationMixer;\n    readonly time: number;\n    speed: number;\n    readonly names: string[];\n    play(name: string, options?: ClipPlayOptions): void;\n    stop(name: string, fade?: number): void;\n    isPlaying(name: string): boolean;\n    advance(dt: number): boolean;\n    setTime(time: number): void;\n    dispose(): void;\n};\nexport declare function createClipPlayer(root: THREE.Object3D, clips?: THREE.AnimationClip[]): ClipPlayer;\nexport declare function bakeClip(root: THREE.Object3D, clip: THREE.AnimationClip, rate?: number): MotionTrack;"
        },
        {
          "file": "glb-gate.ts",
          "declarations": "export type GlbRefusalCode = 'size' | 'header' | 'json' | 'no-mesh' | 'counts' | 'detail' | 'extension' | 'external' | 'binary';\nexport type GlbGateLimits = {\n    maxBytes?: number;\n    maxMeshes?: number;\n    maxNodes?: number;\n    maxVertices?: number;\n    allowedExtensions?: readonly string[];\n    allowDataUris?: boolean;\n};\nexport type GlbGateCounts = {\n    bytes: number;\n    meshes: number;\n    nodes: number;\n    vertices: number;\n    images: number;\n    required: string[];\n};\nexport type GlbGateResult = {\n    ok: true;\n    counts: GlbGateCounts;\n    limits: Required<GlbGateLimits>;\n    gltf: GatedGltf;\n} | {\n    ok: false;\n    code: GlbRefusalCode;\n    reason: string;\n};\nexport type GatedGltf = {\n    asset?: {\n        version?: string;\n    };\n    meshes?: Array<{\n        primitives?: Array<{\n            attributes?: Record<string, number>;\n        }>;\n    }>;\n    nodes?: unknown[];\n    accessors?: Array<{\n        count?: number;\n    }>;\n    buffers?: Array<{\n        uri?: string;\n        byteLength?: number;\n    }>;\n    images?: unknown[];\n    extensionsRequired?: string[];\n    [key: string]: unknown;\n};\nexport declare const GATE_EXTENSIONS: readonly string[];\nexport declare const GATE_DEFAULTS: Required<GlbGateLimits>;\nexport declare function gateGlb(bytes: ArrayBuffer | ArrayBufferView, limits?: GlbGateLimits): GlbGateResult;\nexport declare class GlbRefusedError extends Error {\n    readonly code: GlbRefusalCode;\n    constructor(code: GlbRefusalCode, reason: string);\n}\nexport declare function assertGlb(bytes: ArrayBuffer | ArrayBufferView, limits?: GlbGateLimits): GlbGateCounts;"
        },
        {
          "file": "instanced-model.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { type MotionTrack } from './motion-track';\nexport type InstancedModelOptions = {\n    colours?: (mesh: THREE.Mesh) => boolean;\n    shadows?: boolean;\n};\nexport type InstanceBinding = {\n    track: MotionTrack;\n    nodes: Int32Array;\n    pose: Float32Array;\n};\nexport type InstancedModel = {\n    readonly object: THREE.Group;\n    readonly capacity: number;\n    count: number;\n    readonly nodes: string[];\n    readonly skipped: string[];\n    setPlacement(i: number, matrix: THREE.Matrix4): void;\n    setColour(i: number, colour: THREE.Color): void;\n    bind(track: MotionTrack): InstanceBinding;\n    applyTrack(i: number, binding: InstanceBinding, time: number, loop?: boolean): void;\n    resetPose(i: number): void;\n    commit(): void;\n    dispose(): void;\n};\nexport declare function createInstancedModel(source: THREE.Object3D, capacity: number, options?: InstancedModelOptions): InstancedModel;"
        },
        {
          "file": "model-loader.ts",
          "declarations": "import type * as THREE from 'three/webgpu';\nimport { type GlbGateLimits } from './glb-gate';\nimport { type ModelInfo } from './glb-info';\nexport type ModelSource = {\n    key: string;\n    scene: THREE.Group;\n    clips: THREE.AnimationClip[];\n    info: ModelInfo;\n    bytes: number;\n};\nexport type ModelLoaderOptions = {\n    meshopt?: 'auto' | 'js' | false | object;\n    embeddedImages?: boolean;\n    ktx2?: unknown;\n    draco?: unknown;\n    gate?: boolean | GlbGateLimits;\n    fetchBytes?: (url: string) => Promise<ArrayBuffer>;\n};\nexport type ModelLoader = {\n    load(url: string): Promise<ModelSource>;\n    fromBytes(key: string, bytes: ArrayBuffer, resourcePath?: string): Promise<ModelSource>;\n    get(key: string): ModelSource | undefined;\n    copy(source: ModelSource): THREE.Object3D;\n    release(key: string): void;\n    dispose(): void;\n};\nexport declare function createModelLoader(given?: ModelLoaderOptions): ModelLoader;"
        },
        {
          "file": "motion-recorder.ts",
          "declarations": "import type * as THREE from 'three/webgpu';\nimport { type MotionTrack } from './motion-track';\nexport type RecorderOptions = {\n    rate?: number;\n    scale?: boolean;\n    seconds?: number;\n};\nexport type MotionRecorder = {\n    readonly nodes: string[];\n    readonly frames: number;\n    capture(): void;\n    advance(dt: number): number;\n    finish(): MotionTrack;\n    clear(): void;\n};\nexport declare function createMotionRecorder(targets: THREE.Object3D[] | {\n    root: THREE.Object3D;\n    names: string[];\n}, options?: RecorderOptions): MotionRecorder;"
        },
        {
          "file": "motion-track.ts",
          "declarations": "export type MotionTrack = {\n    rate: number;\n    frames: number;\n    nodes: string[];\n    scale: boolean;\n    loop: boolean;\n    data: Float32Array;\n};\nexport declare const strideOf: (track: Pick<MotionTrack, \"scale\">) => 10 | 7;\nexport declare function trackDuration(track: MotionTrack, loop?: boolean): number;\nexport declare function createPose(track: MotionTrack): Float32Array<ArrayBuffer>;\nexport declare function sampleTrack(track: MotionTrack, time: number, out: Float32Array, loop?: boolean): Float32Array<ArrayBufferLike>;\nexport declare function blendFrames(a: ArrayLike<number>, ao: number, b: ArrayLike<number>, bo: number, t: number, out: Float32Array, oo: number, nodes: number, stride: number): void;\nexport declare function slerpQuat(a: ArrayLike<number>, ao: number, b: ArrayLike<number>, bo: number, t: number, out: Float32Array | Float64Array, oo: number): void;\nexport declare function closeLoop(track: MotionTrack, period: number, blend: number): MotionTrack;\nexport declare function encodeTrack(track: MotionTrack): ArrayBuffer;\nexport declare function decodeTrack(buffer: ArrayBuffer): MotionTrack;\nexport type MotionTrackJson = {\n    format: 'motion-track';\n    version: 1;\n    rate: number;\n    frames: number;\n    nodes: string[];\n    scale: boolean;\n    loop: boolean;\n    data: number[];\n};\nexport declare function trackToJson(track: MotionTrack, decimals?: number): MotionTrackJson;\nexport declare function trackFromJson(json: MotionTrackJson): MotionTrack;"
        },
        {
          "file": "normalise.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nexport type NormaliseOptions = {\n    size?: number;\n    along?: 'height' | 'length' | 'largest';\n    ground?: boolean;\n    centre?: boolean;\n};\nexport type Normalised = {\n    scale: number;\n    size: THREE.Vector3;\n    box: THREE.Box3;\n};\nexport declare function normaliseModel(object: THREE.Object3D, options?: NormaliseOptions): Normalised;"
        },
        {
          "file": "track-player.ts",
          "declarations": "import type * as THREE from 'three/webgpu';\nimport { type MotionTrack } from './motion-track';\nexport declare function bindTrack(track: MotionTrack, root: THREE.Object3D): Array<THREE.Object3D | null>;\nexport declare function applyPose(track: MotionTrack, pose: Float32Array, targets: Array<THREE.Object3D | null>): void;\nexport type TrackPlayerOptions = {\n    loop?: boolean;\n    speed?: number;\n    playing?: boolean;\n    onEnd?: () => void;\n};\nexport type TrackPlayer = {\n    readonly track: MotionTrack;\n    readonly time: number;\n    readonly duration: number;\n    readonly missing: string[];\n    speed: number;\n    loop: boolean;\n    playing: boolean;\n    advance(dt: number): boolean;\n    seek(time: number): void;\n};\nexport declare function createTrackPlayer(track: MotionTrack, root: THREE.Object3D, options?: TrackPlayerOptions): TrackPlayer;"
        },
        {
          "file": "warm-up.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nexport declare function compileUnseen(renderer: THREE.WebGPURenderer, scene: THREE.Scene, camera: THREE.Camera, objects: THREE.Object3D[]): Promise<void>;\nexport declare function drawUnseen(renderer: THREE.WebGPURenderer, scene: THREE.Scene, camera: THREE.Camera, objects: THREE.Object3D[], draw?: () => void): void;\nexport declare function warmUp(renderer: THREE.WebGPURenderer, scene: THREE.Scene, camera: THREE.Camera, objects: THREE.Object3D[], draw?: () => void): Promise<void>;"
        }
      ],
      "pitfalls": [
        "GLTFLoader fetches whatever a file names",
        "Gate budgets count what the file declares, not what it draws",
        "Allow an extension in `extensionsRequired` only when the loader can read it",
        "data: URIs pass the gate (they are inside the file)",
        "Record in fixed steps",
        "A recording is not a loop",
        "Make the period a whole number of frames",
        "Tracks hold local transforms in the model’s own units",
        "Recorded node names must be unique in the model",
        "AnimationMixer.update(dt) makes a clip depend on how many frames ran",
        "InstancedMesh: never culled here (its bounds would be the first copies’)",
        "Instancing composes every shown copy’s nodes on the CPU",
        "A file with KHR_draco needs its decoder",
        "Under a strict Content Security Policy",
        "warmUp draws one frame cut to a pixel",
        "compileAsync culls by the camera, so what starts out of view"
      ],
      "card": "entries/gltf-motion.json"
    },
    {
      "id": "glyph-rivers",
      "aliases": [],
      "name": "Rivers of glyphs",
      "summary": "A field of characters wakes: every glyph lifts off its cell, rises on a curl flow into a few rivers of light, runs along them and pours into a word, where one glyph a point stays and the word is set in them. Stateless: each glyph’s place is worked out from the moment alone, so a hundred thousand to a million of them scrub, rewind and replay exactly, and a held word costs next to nothing.",
      "category": "particles",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "compute",
        "raw webgpu",
        "wgsl",
        "instancing",
        "curl noise",
        "glyph atlas",
        "text effects",
        "stateless",
        "scrubbable",
        "data streams",
        "bloom"
      ],
      "useCases": [
        "title and splash moments",
        "data or AI themed openers",
        "a word or a number assembling on a stage",
        "transitions between sections",
        "loading moments that end on a result",
        "ambient data backdrops"
      ],
      "interaction": "Drag or use the arrow keys to look around · Space plays or pauses · R replays",
      "kits": [],
      "pairsWith": [
        {
          "id": "word-swarm",
          "why": "Birds or drones that write the next word"
        },
        {
          "id": "names-wall",
          "why": "A wall of names into one line"
        },
        {
          "id": "slide-transitions",
          "why": "From the word into the next slide"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 3.635,
          "cpuMs": 0.13,
          "cpuP95Ms": 0.205,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured looping by itself with about 130,000 glyphs: the field wakes, the rivers run and pour into the word over the play time, it holds a second and replays. Every glyph is computed every frame (stateless); one pass draws the field per pixel and one the glyphs, then a quarter-size bloom. Timed with its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.442,
          "cpuMs": 0.3,
          "cpuP95Ms": 0.525,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 701 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 6.712,
          "cpuMs": 0.28,
          "cpuP95Ms": 0.34,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 672 ms."
        }
      ],
      "signatures": [
        {
          "file": "art.ts",
          "declarations": "import { type Word } from './plan';\nexport declare function drawAtlas(cell?: number, family?: string, weight?: number): HTMLCanvasElement;\nexport declare function mipChain(src: HTMLCanvasElement): HTMLCanvasElement[];\nexport declare function drawWordMask(text: string, { family, weight, px, pad }?: {\n    family?: string;\n    weight?: number;\n    px?: number;\n    pad?: number;\n}): HTMLCanvasElement;\nexport declare function maskAlpha(mask: HTMLCanvasElement): {\n    alpha: Uint8Array;\n    w: number;\n    h: number;\n};\nexport type StillLook = {\n    glow?: string;\n    accent?: string;\n    background?: string;\n    ink?: string;\n    family?: string;\n    held?: number;\n};\nexport declare function drawRiversStill(g: CanvasRenderingContext2D, word: Word, keeperChars: Uint8Array, rect: {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n}, look?: StillLook): void;"
        },
        {
          "file": "glyph-rivers.ts",
          "declarations": "import { type Field, type Placement, type V3, type Word } from './plan';\nexport type RiversCamera = {\n    eye: V3;\n    target: V3;\n    fov: number;\n};\nexport type RiversFrame = {\n    progress: number;\n    time: number;\n    velocity?: number;\n    timeScale?: number;\n    camera: RiversCamera;\n};\nexport type RiversLook = {\n    glow: string;\n    accent: string;\n    ink: string;\n    background: string;\n    intensity: number;\n    field: number;\n    hold: number;\n    shimmer: number;\n    flow: number;\n    bloom: number;\n    exposure: number;\n    fog: number;\n    renderScale: number;\n};\nexport type GlyphRiversOptions = {\n    span?: number;\n    rivers?: number;\n    atlas?: {\n        cell?: number;\n        family?: string;\n        weight?: number;\n    };\n};\nexport type RiversTarget = GPUCanvasContext | {\n    view: GPUTextureView;\n    width: number;\n    height: number;\n};\nexport type GlyphRivers = {\n    readonly field: Field;\n    readonly word: Word;\n    readonly keeperChars: Uint8Array;\n    look: RiversLook;\n    setWord(word: Word, place: Placement): void;\n    setRivers(count: number): void;\n    draw(target: RiversTarget, frame: RiversFrame): boolean;\n    warm(width: number, height: number): Promise<void>;\n    heldFrame(frame: Pick<RiversFrame, 'progress' | 'time'>): number | null;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare const DEFAULT_LOOK: RiversLook;\nexport declare function createGlyphRivers(device: GPUDevice, format: GPUTextureFormat, field: Field, word: Word, place: Placement, options?: GlyphRiversOptions): Promise<GlyphRivers>;"
        },
        {
          "file": "plan.ts",
          "declarations": "export type V3 = [\n    number,\n    number,\n    number\n];\nexport declare const CELL: {\n    readonly w: 12;\n    readonly h: 3.6;\n    readonly slots: 9;\n    readonly adv: 1.25;\n    readonly glyph: 2.15;\n};\nexport declare const WAY: {\n    readonly lift: 0.08;\n    readonly rise: 0.36;\n    readonly river: 0.74;\n    readonly pour: 0.94;\n};\nexport declare const SHIMMER_HZ = 6;\nexport declare const TABLE_N = 256;\nexport declare function pcg(v: number): number;\nexport declare const seedKey: (seed: number) => number;\nexport declare const cellHash: (c: number, r: number, key: number) => number;\nexport declare const CHARSET: \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ+-*/=<>#%&@~^|:.,!?\";\nexport type Align = 'left' | 'right';\nexport type CellKind = 'number' | 'decimal' | 'percent' | 'hex' | 'code' | 'symbols';\nexport declare function kindOf(c: number, key: number): CellKind;\nexport declare function cellText(c: number, r: number, seed: number, empty?: number): {\n    text: string;\n    align: Align;\n};\nexport declare function slotOf(text: string, align: Align, k: number): number;\nexport type FieldSpec = {\n    cols: number;\n    rows: number;\n    seed?: number;\n    origin?: [\n        number,\n        number\n    ];\n    jitter?: number;\n    empty?: number;\n};\nexport declare function fieldGeometry(spec: FieldSpec): {\n    halfW: number;\n    depth: number;\n    ox: number;\n    oz: number;\n    maxDist: number;\n    key: number;\n    jitter: number;\n};\nexport type FieldGeometry = ReturnType<typeof fieldGeometry>;\nexport declare function wakeOf(c: number, r: number, geo: FieldGeometry): number;\nexport declare function readTable(table: ArrayLike<number>, v: number): number;\nexport declare function journeyOf(rank: number, progress: number, span: number): number;\nexport declare function buildField(spec: FieldSpec): {\n    spec: FieldSpec;\n    geo: {\n        halfW: number;\n        depth: number;\n        ox: number;\n        oz: number;\n        maxDist: number;\n        key: number;\n        jitter: number;\n    };\n    count: number;\n    x: Float32Array<ArrayBuffer>;\n    z: Float32Array<ArrayBuffer>;\n    rank: Float32Array<ArrayBuffer>;\n    chars: Uint8Array<ArrayBuffer>;\n    share: Float32Array<ArrayBuffer>;\n    order: Uint32Array<ArrayBufferLike>;\n};\nexport type Field = ReturnType<typeof buildField>;\nexport declare function rankOrder(rank: Float32Array): Uint32Array;\nexport type Target = {\n    u: number;\n    v: number;\n    col: number;\n    row: number;\n};\nexport declare const WORD_CELL: number;\nexport declare function wordTargets(alpha: ArrayLike<number>, w: number, h: number, columns: number, threshold?: number): {\n    targets: Target[];\n    columns: number;\n    rows: number;\n    aspect: number;\n};\nexport type Word = ReturnType<typeof wordTargets>;\nexport declare function assignTargets(field: Field, targetCount: number): {\n    bits: Uint32Array;\n    keeperChars: Uint8Array;\n};\nexport type Placement = {\n    center: V3;\n    width: number;\n};\nexport declare const targetPoint: (t: Target, word: Word, place: Placement) => V3;\nexport declare const wordScale: (word: Word, place: Placement) => number;\nexport type River = {\n    a: V3;\n    b: V3;\n    c: V3;\n    d: V3;\n    radius: number;\n};\nexport declare function riversOf(geo: FieldGeometry, word: Word, place: Placement, count: number, seed?: number): River[];\nexport declare function bezier(a: V3, b: V3, c: V3, d: V3, u: number): V3;"
        }
      ],
      "pitfalls": [
        "Stateless means every glyph is computed every frame, waiting or not",
        "Every point of the word keeps exactly one glyph only when the field has more glyphs than the…",
        "Progress must reach exactly 1 for the word to be held still",
        "The streaks need to know how fast progress moves (velocity) and how fast time runs (timeScale)",
        "Load the font before drawing the word mask and before creating the rivers",
        "Never queue more than one frame ahead",
        "Changing the field (its size, seed or origin) means building the field and the rivers again",
        "Without WebGPU, draw the still (drawRiversStill)"
      ],
      "card": "entries/glyph-rivers.json"
    },
    {
      "id": "gpu-cloth",
      "aliases": [],
      "name": "GPU cloth",
      "summary": "Flags, banners, tarps, curtains and nets that move in the wind and tear when shot, all in one set of GPU buffers. One compute pass a step moves every Verlet point, ten relaxing passes pull each toward its neighbours (from one buffer into another, so the parallel solve never feeds itself energy), and one instanced draw shows every piece, so more cloth costs more points, not more draws. Wind is a drag toward the air’s speed, pressing mostly across the cloth’s face, with eddies that roll along it, so it flaps faster the harder it blows; gusts, and an optional push such as a blast’s shockwave, come in as uniforms and TSL nodes. A shot cuts every link near its ray through every fold it crosses; torn pieces fall free while tethers keep long hangs from stretching, and mend() makes them whole. The demo’s yard (five pieces of 28 × 20 points) costs about 0.9 ms of GPU and 0.3 ms of CPU a frame at 1080p on a laptop RTX 4060, in 11 compute dispatches and 7 draws. Without WebGPU, the same step runs on three’s WebGL2 backend as full-screen passes into float render targets. Use it for flags and banners, awnings, curtains, nets and destructible cloth in a three.js scene.",
      "category": "simulation",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "balanced",
      "tags": [
        "verlet",
        "compute",
        "wind",
        "tearing",
        "instancing",
        "alpha to coverage",
        "tsl"
      ],
      "useCases": [
        "flags and banners",
        "tarps and awnings",
        "curtains",
        "nets",
        "destructible cloth"
      ],
      "interaction": "Click the cloth to shoot through it · drag to orbit · click, then scroll to zoom",
      "kits": [],
      "pairsWith": [
        {
          "id": "ring-effects",
          "why": "Streaks and marks for the shots that tear it"
        },
        {
          "id": "post-stack",
          "why": "Occlusion and bloom on banners in the light"
        }
      ],
      "variants": [
        {
          "id": "stitched-dom",
          "note": "In raw WGSL with the same Jacobi Verlet: loads sewn in rest space, links that fray, tear and mend, and DOM text read back onto the cloth with CSS matrix3d; a CPU twin as fallback."
        }
      ],
      "version": "1.1.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": 0.931,
          "cpuMs": 0.29,
          "cpuP95Ms": 0.545,
          "badge": "moderate",
          "drawCalls": 7,
          "computeDispatches": 11,
          "frames": null,
          "notes": null
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 3.146,
          "cpuMs": 0.885,
          "cpuP95Ms": 1.645,
          "badge": "heavy",
          "drawCalls": 10,
          "computeDispatches": 11,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 148 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 2.742,
          "cpuMs": 0.08,
          "cpuP95Ms": 0.12,
          "badge": "heavy",
          "drawCalls": 10,
          "computeDispatches": 11,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 771 ms."
        }
      ],
      "signatures": [
        {
          "file": "cloth.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node, StorageBufferNode } from 'three/webgpu';\ntype Vec4s = StorageBufferNode<'vec4'>;\nexport type ClothKind = 'flag' | 'banner' | 'tarp' | 'curtain' | 'net';\nexport type ClothPiece = {\n    kind: ClothKind;\n    at: THREE.Vector3Like;\n    across: THREE.Vector3Like;\n    down: THREE.Vector3Like;\n    width: number;\n    height: number;\n    colours: [\n        string,\n        string,\n        string\n    ];\n};\nexport declare const NET_MESH = 0.195;\nexport declare const NET_TWINE = 0.02;\nexport type ClothPush = (xz: Node<'vec2'>) => Node<'vec2'>;\nexport type ClothOptions = {\n    cols?: number;\n    rows?: number;\n    push?: ClothPush;\n    textures?: boolean;\n};\nexport declare class Cloth {\n    readonly mesh: THREE.Mesh;\n    readonly cols: number;\n    readonly rows: number;\n    readonly pieces: ClothPiece[];\n    readonly wind: THREE.UniformNode<\"vec4\", THREE.Vector4>;\n    readonly gust: THREE.UniformNode<\"float\", number>;\n    readonly storage: 'buffers' | 'textures';\n    readonly points: Vec4s | null;\n    readonly links: Vec4s | null;\n    static needsTextures(renderer: THREE.WebGPURenderer): boolean;\n    static canRenderFloat(renderer: THREE.WebGPURenderer): boolean;\n    constructor(pieces: ClothPiece[], { cols, rows, push, textures }?: ClothOptions);\n    place(c: number, piece: ClothPiece, fresh?: boolean): void;\n    tear(renderer: THREE.WebGPURenderer, from: THREE.Vector3Like, along: THREE.Vector3Like, radius?: number, reach?: number): void;\n    compile(renderer: THREE.WebGPURenderer): Promise<void>;\n    mend(): void;\n    update(renderer: THREE.WebGPURenderer, dt: number): void;\n    dispose(): void;\n}\nexport {};"
        }
      ],
      "pitfalls": [
        "No over-relaxation, and solve from one buffer into another",
        "Every constraint must pull from both ends",
        "Work the normal out per vertex and interpolate it",
        "A face goes when any of its points is torn or strained (a neighbour past three rest spacings)",
        "Air presses mostly across a cloth’s face (along its normal) and little along it",
        "Do not snap links by stretch",
        "Without long-range tethers to the pins, a long hang stretches",
        "Wind as a drag toward the air’s speed, never a constant push",
        "The soft net and tear edges need MSAA (antialias: true) and alpha to coverage",
        "A shot is cut in its own compute pass",
        "Without WebGPU, pass `textures: Cloth.needsTextures(renderer)`"
      ],
      "card": "entries/gpu-cloth.json"
    },
    {
      "id": "gpu-crossfilter",
      "aliases": [],
      "name": "Cross-filtered WebGPU dashboard",
      "summary": "A cross-filtered dashboard where every record is one mark on one WebGPU canvas, up to a million of them. Records live in storage buffers; one compute pass tests every brush and fills every chart’s histogram with atomics; marks are placed statelessly from those eased histograms, so any chart can re-form into any other (a flight, not a cut); an exact shape layer keeps each bar pixel-sharp under its marks; the driver draws only when something changes. Columns, rows, a category matrix and a scatter, brushed by pointer or keys, exact integer sums for headline figures, a GPU picker for hover, live arrivals that fly in, and an audit that recounts every cell on the CPU. Without WebGPU, the same charts from CPU counts.",
      "category": "data",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "crossfilter",
        "brushing",
        "linked views",
        "unit visualization",
        "histogram",
        "compute",
        "atomics",
        "webgpu",
        "raw webgpu",
        "morph",
        "animated transitions",
        "scatter",
        "heat matrix",
        "dashboard",
        "million points",
        "picking",
        "audit",
        "keyboard",
        "reduced motion",
        "no dependencies"
      ],
      "useCases": [
        "brushing linked charts over a big table",
        "dashboards that keep every record visible",
        "a large chart any other can fly into",
        "live feeds that fly into every chart",
        "headline figures that add up exactly",
        "proving GPU numbers with a CPU audit"
      ],
      "interaction": "Drag across any chart to brush it · click rows and cells · Tab to a chart, then the arrows (Shift to resize, Escape to clear)",
      "kits": [
        {
          "kit": "dashboard",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "data-table",
          "why": "The brushed records as rows"
        },
        {
          "id": "chart-access",
          "why": "The brushed totals as a table"
        },
        {
          "id": "date-picker",
          "why": "A date range as one more filter"
        }
      ],
      "variants": [],
      "version": "1.0.2",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "The discs drawn on tighter quads (the same picture), the pixel ratio capped at 1.5.",
          "low": "100,000 marks instead of 250,000, on tighter quads, at 1 px per CSS px."
        },
        "reducedMotion": false
      },
      "toneKnobs": [
        {
          "name": "calm",
          "in": "module",
          "values": {
            "strict": true
          },
          "note": "short cross-fades instead of flights"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 1.367,
          "cpuMs": 0.125,
          "cpuP95Ms": 0.18,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured at 250,000 marks in the overview, a time brush sweeping across the day (a cross-filter pass over every order, the eased histograms, and six views of marks redrawn each frame), the large chart changing every 4 s (a flight)."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 15.925,
          "cpuMs": 0.28,
          "cpuP95Ms": 0.605,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 710 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 9.802,
          "cpuMs": 0.3,
          "cpuP95Ms": 0.46,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 469 ms."
        }
      ],
      "signatures": [
        {
          "file": "brush.ts",
          "declarations": "import type { Brush, CompiledChart } from './schema';\nexport type BrushTarget = {\n    kind: 'columns';\n    bins: number;\n} | {\n    kind: 'rows';\n    bins: number;\n} | {\n    kind: 'matrix';\n    rows: number;\n    cols: number;\n} | {\n    kind: 'scatter';\n    xBins: number;\n    yBins: number;\n};\nexport declare const targetOf: (ch: CompiledChart) => BrushTarget;\nexport declare function binAt(t: BrushTarget, fx: number, fy: number): number;\nexport declare function valueAt(t: Extract<BrushTarget, {\n    kind: 'scatter';\n}>, fx: number, fy: number): [\n    number,\n    number\n];\nexport declare function brushBox(t: BrushTarget, b: Brush | null): [\n    number,\n    number,\n    number,\n    number\n] | null;\nexport declare function partAt(t: BrushTarget, b: Brush | null, fx: number, fy: number, ex: number, ey: number): number;\nexport declare function dragBrush(t: BrushTarget, start: {\n    fx: number;\n    fy: number;\n    part: number;\n    brush: Brush | null;\n}, fx: number, fy: number): Brush | null;\nexport declare function toggleBin(b: Brush | null, bin: number): Brush | null;\nexport declare const setBins: (b: Brush | null) => number[];\nexport declare function keyBrush(t: BrushTarget, b: Brush | null, cursor: number, key: string, shift: boolean): {\n    brush: Brush | null;\n    cursor: number;\n    used: boolean;\n};\nexport type BrushControl = {\n    readonly cursor: number;\n    dispose(): void;\n};\nexport declare function attachBrush(plot: HTMLElement, o: {\n    target: () => BrushTarget;\n    get: () => Brush | null;\n    set: (b: Brush | null) => void;\n    onDrag?: (on: boolean) => void;\n    onHover?: (p: {\n        fx: number;\n        fy: number;\n        e: PointerEvent;\n    } | null) => void;\n    onCursor?: (cursor: number) => void;\n}): BrushControl;"
        },
        {
          "file": "crossfilter.ts",
          "declarations": "import { type Brush, type Compiled, type Schema } from './schema';\nexport type Rect = {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n};\nexport type View = {\n    chart: number;\n    rect: Rect;\n};\nexport type Histogram = {\n    counts: Uint32Array;\n    brushes: ReadonlyArray<Brush | null>;\n    colorBy: number | null;\n};\nexport type CrossfilterTheme = {\n    background: string;\n    palette: string[];\n    context: string;\n    contextAlpha?: number;\n    accent: string;\n    paper?: boolean;\n};\nexport type CrossfilterTier = 'high' | 'medium' | 'low';\nexport declare const CROSSFILTER_TIERS: Record<CrossfilterTier, {\n    quadPad: number;\n    maxPixelRatio: number;\n}>;\nexport type CrossfilterOptions = {\n    schema: Schema;\n    capacity: number;\n    theme: CrossfilterTheme;\n    calm?: boolean;\n    colorBy?: number | null;\n    autoFrame?: boolean;\n    device?: GPUDevice;\n    tier?: CrossfilterTier;\n    maxPixelRatio?: number;\n    onHistogram?(h: Histogram): void;\n    onScale?(): void;\n    onLanded?(): void;\n    onLost?(message: string): void;\n    onProgress?(built: number, of: number): void;\n};\nexport type Crossfilter = {\n    readonly device: GPUDevice;\n    readonly schema: Compiled;\n    readonly count: number;\n    setRecords(packed: Uint32Array, count: number, measure?: ArrayLike<number> | null, totals?: Float64Array): void;\n    append(packed: Uint32Array, count: number, measure?: ArrayLike<number> | null): void;\n    setViews(views: ReadonlyArray<View | null>, fly?: boolean): void;\n    setBrush(chart: number, brush: Brush | null): void;\n    setBrushes(brushes: ReadonlyArray<Brush | null | undefined>): void;\n    readonly brushes: ReadonlyArray<Brush | null>;\n    setColorBy(field: number | null): void;\n    readonly colorBy: number | null;\n    setTheme(theme: CrossfilterTheme): void;\n    calm: boolean;\n    hold(on: boolean): void;\n    setRings(indices: ReadonlyArray<number>): void;\n    pick(view: number, x: number, y: number, radius?: number): Promise<number>;\n    histogram(): Histogram | null;\n    histogramAfter(): Promise<Histogram>;\n    totals(): Float64Array;\n    records(): {\n        packed: Uint32Array;\n        measure: Uint32Array | null;\n        count: number;\n    };\n    scale(chart: number): {\n        now: number;\n        target: number;\n    };\n    frame(dt: number): boolean;\n    invalidate(): void;\n    resize(width: number, height: number, dpr: number): void;\n    settled(): boolean;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare const MAX_RECORDS: number;\nexport declare function hexToRgb(hex: string): [\n    number,\n    number,\n    number\n];\nexport declare function createCrossfilter(canvas: HTMLCanvasElement, opts: CrossfilterOptions): Promise<Crossfilter | null>;"
        },
        {
          "file": "schema.ts",
          "declarations": "export declare const MAX_FIELDS = 8;\nexport declare const MAX_CHARTS = 8;\nexport declare const GROUPS = 8;\nexport declare const MEASURE_LIMIT: number;\nexport declare const SUM_RECORDS: number;\nexport type Field = {\n    id: string;\n    label?: string;\n    bins: number;\n};\nexport type ChartSpec = {\n    kind: 'columns';\n    id: string;\n    field: number;\n    bins?: number;\n    sum?: boolean;\n} | {\n    kind: 'rows';\n    id: string;\n    field: number;\n    sum?: boolean;\n} | {\n    kind: 'matrix';\n    id: string;\n    row: number;\n    col: number;\n    sum?: boolean;\n} | {\n    kind: 'scatter';\n    id: string;\n    x: number;\n    y: number;\n};\nexport type Schema = {\n    fields: Field[];\n    charts: ChartSpec[];\n};\nexport type Brush = {\n    kind: 'range';\n    lo: number;\n    hi: number;\n} | {\n    kind: 'rect';\n    x0: number;\n    x1: number;\n    y0: number;\n    y1: number;\n} | {\n    kind: 'set';\n    bins: number[];\n};\nexport declare const KIND: {\n    readonly columns: 0;\n    readonly rows: 1;\n    readonly matrix: 2;\n    readonly scatter: 3;\n};\nexport type CompiledChart = {\n    id: string;\n    kind: ChartSpec['kind'];\n    code: number;\n    a: number;\n    b: number;\n    aBins: number;\n    bBins: number;\n    bins: number;\n    binOff: number;\n    sumOff: number;\n};\nexport type Compiled = {\n    fields: Field[];\n    charts: CompiledChart[];\n    stride: number;\n    nb: number;\n    ns: number;\n    histLen: number;\n};\nexport declare function compile(schema: Schema): Compiled;\nexport declare const fieldOf: (packed: Uint32Array, stride: number, i: number, f: number) => number;\nexport declare function packRecords(cs: Compiled, columns: ArrayLike<number>[], count: number, out?: Uint32Array<ArrayBuffer>): Uint32Array;\nexport declare function packOne(cs: Compiled, values: ArrayLike<number>, out: Uint32Array, i: number): void;\nexport declare function binOf(ch: CompiledChart, packed: Uint32Array, stride: number, i: number): number;\nexport declare const groupOf: (colorBy: number | null, packed: Uint32Array, stride: number, i: number) => number;\nexport declare function encodeBrushes(cs: Compiled, brushes: ReadonlyArray<Brush | null | undefined>): Uint32Array;\nexport declare function passBits(cs: Compiled, enc: Uint32Array, packed: Uint32Array, i: number): number;\nexport declare function binPasses(cs: Compiled, enc: Uint32Array, c: number, bin: number): boolean;\nexport declare function cpuHistogram(cs: Compiled, packed: Uint32Array, count: number, brushes: ReadonlyArray<Brush | null | undefined>, colorBy: number | null, measure?: ArrayLike<number> | null): Float64Array;\nexport declare function addTotals(cs: Compiled, packed: Uint32Array, from: number, to: number, tot: Float64Array): Float64Array;\nexport declare function chartCounts(cs: Compiled, h: ArrayLike<number>, c: number): Float64Array;\nexport declare function passingCounts(cs: Compiled, h: ArrayLike<number>, c: number, brushes: ReadonlyArray<Brush | null | undefined>): Float64Array;\nexport declare function passingSums(cs: Compiled, h: ArrayLike<number>, c: number, brushes: ReadonlyArray<Brush | null | undefined>): Float64Array;\nexport declare function totals(cs: Compiled, h: ArrayLike<number>, brushes: ReadonlyArray<Brush | null | undefined>): {\n    count: number;\n    sum: number | null;\n};\nexport declare function quantileBin(counts: ArrayLike<number>, q: number): number;\nexport declare function niceCeil(v: number): number;"
        }
      ],
      "pitfalls": [
        "Fields are whole numbers 0..65,535 packed two to a word",
        "Exact sums: a measure value must stay under 2^24",
        "The totals that pass every brush come from the cross-filter counts with the chart’s own brush…",
        "A chart nobody draws still counts",
        "Atomics on a chart with few bins (a status row of four) contend",
        "Readbacks are asynchronous and the newest wins",
        "Views are CSS pixels from the canvas’s top left",
        "Field 0 orders the wave of a flight (records leave in its order)",
        "The view index is the identity a flight follows",
        "The capacity grows when more records arrive (buffers reallocated and copied, pipelines kept)",
        "Derive figures from a histogram with the brushes it carries (h.brushes), not the live ones",
        "With autoFrame off (inside another loop), call frame(dt) every frame",
        "On an integrated GPU the record count is the dial",
        "Timestamp queries need the timestamp-query feature",
        "The first compile on a cold shader cache takes seconds"
      ],
      "card": "entries/gpu-crossfilter.json"
    },
    {
      "id": "gpu-foliage",
      "aliases": [],
      "name": "Trees grown in compute",
      "summary": "A broadleaf tree, a spruce and a flowering bush grown on the GPU: branches by space colonisation toward a crown you shape (or whorls up a leader), tapered by the pipe model, clothed in real leaf shapes, needle sprays, flowers and berries set by phyllotaxis. The crown shades itself through a leaf-area grid, so it is dark inside and glows where the sun comes through; it throws a soft shadow on the ground. Wind bends every joint, gusts travel across the crown and leaves flutter; with branch springs on, each joint is a damped spring pulled toward the wind’s bend, so gust fronts roll through a garden plant by plant, limbs lag and swing, and a touch swings the limbs it strikes, which settle after a few swings, the trunk carrying them. The year runs through buds, spring green, autumn colour and leaf fall (leaves tumble and settle) to bare boughs under snow; a growth ceremony replays it all. Culled and drawn with indirect draws. A forest of a few hundred trees from four grown ones: each captured once and baked into instanced variants at three leaf levels (75, 30 and 10 %), the crowns casting from their lightest level only, the nearest tree of each kind left live and moved there without a re-bake.",
      "category": "simulation",
      "role": "hero-visual",
      "stack": [
        "three",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "trees",
        "foliage",
        "vegetation",
        "space colonisation",
        "pipe model",
        "compute",
        "indirect draw",
        "lod",
        "wind",
        "seasons",
        "falling leaves",
        "translucency",
        "self-shadowing",
        "snow",
        "tsl",
        "forest",
        "instancing",
        "baked variants",
        "hero objects",
        "hysteresis",
        "shadow layer",
        "cloud shadows",
        "branch physics",
        "springs",
        "gust fronts",
        "touch"
      ],
      "useCases": [
        "trees and bushes in games and configurators",
        "gardens, parks and landscapes",
        "seasonal scenes and time-lapses",
        "growth ceremonies and title moments",
        "architectural visualisation",
        "forests and woods of hundreds of trees in games and walk-throughs",
        "baking a live simulated object into cheap instanced copies with a live one near the camera",
        "trees that react when a player brushes past or strikes them",
        "gusts you can watch roll across a garden"
      ],
      "interaction": "Click a crown to strike it (its limbs swing away from you) · drag to orbit · try Season, Play the year and Grow · Branch physics · Show a forest",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "meadow-grass",
          "why": "Grass under the trees"
        },
        {
          "id": "brush-through",
          "why": "Bushes that part as things pass"
        },
        {
          "id": "plants-burn",
          "why": "Trees that catch and burn"
        }
      ],
      "variants": [
        {
          "id": "growing-tree",
          "note": "Grown by rule from a seed (Weber and Penn) and drawn growing from one number in the vertex shader, with a WebGL fallback"
        }
      ],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "Medium detail: three quarters of the leaves, simpler far leaves and bark, 70 % of the grass.",
          "low": "Light detail: half the leaves (drawn larger), simpler far leaves and bark, half the grass, a smaller forest shadow map."
        },
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 1.652,
          "cpuMs": 0.35,
          "cpuP95Ms": 0.92,
          "badge": "moderate",
          "drawCalls": 4,
          "computeDispatches": 3,
          "frames": null,
          "notes": "Three plants and the grass tufts in a 6 m/s gusty wind, summer, the whole scene in view, the broadleaf shaken every 3 s: per plant six compute passes a frame (bend, move, reset, list branches, list leaves, clamp) and four to six indirect draws."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 15.86,
          "cpuMs": 1.455,
          "cpuP95Ms": 2.1,
          "badge": "heavy",
          "drawCalls": 4,
          "computeDispatches": 3,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 6837 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 8.734,
          "cpuMs": 0.14,
          "cpuP95Ms": 0.2,
          "badge": "heavy",
          "drawCalls": 4,
          "computeDispatches": 3,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 4107 ms."
        }
      ],
      "signatures": [
        {
          "file": "envelope.ts",
          "declarations": "type V3 = [\n    number,\n    number,\n    number\n];\nexport type Envelope = {\n    kind: 'ellipsoid';\n    centre: V3;\n    radii: V3;\n    squash?: number;\n    rough?: number;\n} | {\n    kind: 'cone';\n    base: number;\n    height: number;\n    radius: number;\n} | {\n    kind: 'dome';\n    radius: number;\n    height: number;\n} | {\n    kind: 'box';\n    min: V3;\n    max: V3;\n} | {\n    kind: 'points';\n    points: Float32Array;\n};\nexport type Scatter = {\n    count: number;\n    clumps: number;\n    seed: number;\n    scale?: number;\n};\nexport declare function inside(env: Envelope, x: number, y: number, z: number): boolean;\nexport declare function envelopeBounds(env: Envelope): {\n    min: V3;\n    max: V3;\n};\nexport declare function scatter(env: Envelope, s: Scatter): Float32Array;\nexport declare function lonely(points: Float32Array, radius: number, least: number): Float32Array;\nexport declare function envelopeFromMesh(positions: Float32Array, count: number, seed?: number): Envelope;\nexport {};"
        },
        {
          "file": "environment.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { type GustFronts } from './branch-springs';\nexport type Wind = {\n    speed: number;\n    direction: number;\n    gustiness: number;\n};\nexport type Light = {\n    sun: THREE.Vector3;\n    sunColour: THREE.Color;\n    sky: THREE.Color;\n    horizon: THREE.Color;\n    ground: THREE.Color;\n};\nexport type SunShade = (world: any) => any;\nexport declare function createEnvironment(init?: {\n    wind?: Partial<Wind>;\n    light?: Partial<Light>;\n    sunShade?: SunShade;\n}): {\n    u: {\n        sun: any;\n        sunColour: any;\n        sky: any;\n        horizon: any;\n        ground: any;\n        windDir: any;\n        windSpeed: any;\n        gustiness: any;\n        travel: any;\n        time: any;\n    };\n    wind: Wind;\n    setWind(w: Partial<Wind>): void;\n    setLight(l: Partial<Light>): void;\n    sunShade: SunShade | null;\n    lightVersion: number;\n    fronts: GustFronts;\n    update(dt: number): void;\n};\nexport type Environment = ReturnType<typeof createEnvironment>;"
        },
        {
          "file": "foliage.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\nimport { type BranchResponse } from './branch-springs';\nimport { type Envelope } from './envelope';\nimport { type Environment, type Wind } from './environment';\nimport { type Species, type SpeciesName } from './species';\nimport { type N } from './store';\nexport type Tier = 'rich' | 'light';\nexport type QualityTier = 'high' | 'medium' | 'low';\nexport declare const FOLIAGE_TIER: Record<QualityTier, {\n    leaves: number;\n    thickPixels: number;\n    nearDistance: number;\n    detailDistance: number;\n    farDistance: number;\n}>;\nexport declare function foliageLeafCount(species: Species, tier?: Tier | QualityTier): number;\nexport type GrowAllowance = {\n    steps?: number;\n    ms?: number;\n    nextFrame?: () => Promise<unknown>;\n};\nexport type FoliageOptions = {\n    species: SpeciesName | Species;\n    envelope?: Envelope;\n    seed?: number;\n    leafCount?: number;\n    tier?: Tier | QualityTier;\n    season?: number;\n    wind?: Partial<Wind>;\n    environment?: Environment;\n    position?: [\n        number,\n        number,\n        number\n    ];\n    rotation?: number;\n    thickPixels?: number;\n    branches?: boolean | Partial<BranchResponse>;\n};\nexport type Capture = {\n    leaves: Float32Array;\n    count: number;\n    pos: Float32Array;\n    meta: Float32Array;\n    nodes: number;\n    turn: number;\n    through: [\n        number,\n        number,\n        number\n    ];\n    bark: [\n        number,\n        number,\n        number\n    ];\n};\nexport declare class Foliage {\n    readonly object3D: THREE.Group<THREE.Object3DEventMap>;\n    readonly species: Species;\n    readonly environment: Environment;\n    stats: {\n        nodes: number;\n        leaves: number;\n        steps: number;\n    } | null;\n    readonly shadow: {\n        texture: THREE.StorageTexture;\n        centre: Node<'vec2'>;\n        size: Node<'float'>;\n        ready: Node<'float'>;\n    };\n    constructor(renderer: THREE.WebGPURenderer, scene: THREE.Object3D, options: FoliageOptions);\n    warm(allowance?: GrowAllowance): Promise<void>;\n    grow(seconds?: number): void;\n    get growing(): boolean;\n    setSeason(season: number, options?: {\n        instant?: boolean;\n    }): void;\n    get seasonValue(): number;\n    get seasonNode(): Node<'float'>;\n    shake(point?: THREE.Vector3, strength?: number): void;\n    kick(point: THREE.Vector3, push: THREE.Vector3, strength?: number): void;\n    setBranches(on: boolean | Partial<BranchResponse>): void;\n    get branches(): BranchResponse | null;\n    get gust(): number;\n    intersect(ray: THREE.Ray): THREE.Vector3 | null;\n    update(dt: number, camera: THREE.Camera): void;\n    moveTo(x: number, y: number, z: number, turn?: number): void;\n    get placement(): {\n        x: any;\n        y: any;\n        z: any;\n        turn: number;\n    };\n    setThickPixels(pixels: number): void;\n    capture(options?: {\n        turn?: number;\n    }): Promise<Capture>;\n    dispose(): void;\n}\nexport declare function foliageSupported(renderer: THREE.WebGPURenderer): boolean;\nexport declare function createFoliage(renderer: THREE.WebGPURenderer, scene: THREE.Object3D, options: FoliageOptions): Foliage;\nexport declare function groundShade(plants: Foliage[], world: N): any;"
        },
        {
          "file": "forest.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { type BarkKind } from './bark';\nimport type { Environment } from './environment';\nimport type { Foliage } from './foliage';\nimport { type LeafLevel, type TreeSpot } from './forest-plan';\nexport type { TreeSpot, LeafLevel } from './forest-plan';\nexport type ForestOptions = {\n    plants: Foliage[];\n    spots: TreeSpot[];\n    environment: Environment;\n    capacity?: number;\n    turns?: number[];\n    levels?: readonly LeafLevel[];\n    heroes?: {\n        range?: number;\n        keep?: number;\n    } | false;\n    near?: number;\n    shadowRange?: number;\n    shadowLayer?: number;\n    bark?: BarkKind;\n};\nexport declare class Forest {\n    readonly object3D: THREE.Group<THREE.Object3DEventMap>;\n    readonly heroes: Set<number>;\n    readonly stats: {\n        trees: number;\n        levels: number[];\n        heroes: number;\n        triangles: number;\n    };\n    shadowVersion: number;\n    static create(renderer: THREE.WebGPURenderer, scene: THREE.Object3D, options: ForestOptions): Promise<Forest>;\n    get visible(): boolean;\n    set visible(on: boolean);\n    setHeroes(on: boolean): void;\n    get variantCount(): number;\n    variantOf(spot: number): number;\n    setSpots(spots: TreeSpot[]): void;\n    showLevels(on: boolean): void;\n    rebake(): Promise<void>;\n    warm(camera: THREE.Camera, scene: THREE.Scene): Promise<void>;\n    update(dt: number, camera: THREE.Camera): void;\n    dispose(): void;\n}\nexport type { Capture } from './foliage';\nexport declare function createForest(renderer: THREE.WebGPURenderer, scene: THREE.Object3D, options: ForestOptions): Promise<Forest>;"
        },
        {
          "file": "species.ts",
          "declarations": "import type { Envelope } from './envelope';\nexport type SpeciesName = 'broadleaf' | 'spruce' | 'bush';\nexport type LeafShape = 'broad' | 'small' | 'spray';\nexport type RGB = [\n    number,\n    number,\n    number\n];\nexport type Species = {\n    name: SpeciesName;\n    grower: 'colonise' | 'whorled';\n    envelope: Envelope;\n    trunk: {\n        height: number;\n        lean: number;\n        stems: number;\n        forks?: number;\n        forkLength?: number;\n    };\n    growth: {\n        step: number;\n        influence: number;\n        kill: number;\n        attractors: number;\n        clumps: number;\n        iterations: number;\n        sag?: number;\n        tropism: [\n            number,\n            number,\n            number\n        ];\n        tipRadius: number;\n        exponent: number;\n        whorl?: {\n            spacing: number;\n            branches: number;\n            droop: number;\n            hang: number;\n        };\n    };\n    leaf: {\n        shape: LeafShape;\n        size: number;\n        count: {\n            rich: number;\n            light: number;\n        };\n        twigTips: number;\n        forward: number;\n        droop: number;\n        evergreen: boolean;\n    };\n    colour: {\n        young: RGB;\n        summer: RGB;\n        autumn: RGB[];\n        through: RGB;\n        bark: RGB;\n    };\n    flowers?: {\n        colour: RGB;\n        centre: RGB;\n        size: number;\n        share: number;\n    };\n    berries?: {\n        colour: RGB;\n        size: number;\n        share: number;\n    };\n    wind: {\n        flex: number;\n        sway: number;\n        flutter: number;\n    };\n};\nexport declare const SPECIES: Record<SpeciesName, Species>;\nexport declare const YEAR: {\n    readonly bud: 0.55;\n    readonly budSpread: 0.3;\n    readonly open: 0.55;\n    readonly turn: 2.45;\n    readonly turnSpread: 0.45;\n    readonly turning: 0.35;\n    readonly fall: 0.3;\n    readonly fallSpread: 0.5;\n    readonly snowFrom: 3.55;\n    readonly snowFull: 3.85;\n    readonly snowGone: 0.5;\n};\nexport declare function leafMoments(h: [\n    number,\n    number,\n    number\n], sun: number): {\n    bud: number;\n    turn: number;\n    fall: number;\n};\nexport declare function leafAt(s: number, h: [\n    number,\n    number,\n    number\n], sun: number): {\n    size: number;\n    green: number;\n    turned: number;\n    attached: boolean;\n};\nexport declare function snowAt(s: number): number;\nexport declare function seasonName(s: number): string;"
        }
      ],
      "pitfalls": [
        "The demo needs WebGPU: the plant is grown, bent by the wind, culled and shaded in compute",
        "A storage texture starts at zero, and the ground shadow’s zero is full shade",
        "Do not grow every plant before the first frame",
        "Check a swept tube’s winding against the turn its rings are placed by",
        "Wrap bark by a frame that holds still on upright wood",
        "Space colonisation searches every node for every point, every step",
        "Clamp the turn a step: a shoot continuing its limb turns at most about 28°",
        "Sum the pulls on a node with integer atomics (fixed point)",
        "A lone attraction point far from the rest grows one long bare whip out to it",
        "The pipe model alone makes long limbs with few tips whip-thin",
        "Light the twigs from twig density alone when deciding where leaves go",
        "Fix each leaf’s exposure from the first (summer) bake for its autumn timing",
        "Wind is a small rotation per joint, summed down to every node",
        "Where a limb bends sharply, do not average the two tubes’ ring directions",
        "Small shaded twigs that carry no leaves bristle along the limbs like thorns when drawn",
        "TSL: an atomic load used inside an expression",
        "Each `renderer.compute(node)` is its own submit, so a uniform may change between calls",
        "The plant is placed by its `position` and `rotation` options, in the shaders",
        "Needle sprays need MSAA for alpha to coverage, and their alpha thins in the smaller mips",
        "On a weak GPU set `tier` to low (FOLIAGE_TIER)",
        "A rebake (light through the crown, the ground shadow) costs about half a millisecond a plant",
        "A forest is not a few hundred live plants (six compute passes a frame each)",
        "Let the crowns cast from their lightest level only",
        "Draw only the trees in a cone 20° wider than the view, and every tree within 14 m",
        "A hero tree keeps its spot until another of its kind is 6 m nearer",
        "Moving a live plant (`moveTo`) must not bake",
        "A baked tree’s light is for the sun it was captured under, so an instance cannot be turned",
        "Compile a forest by showing each mesh only for the moment its `compileAsync` starts",
        "Compile a plant’s compute passes ahead (`compileComputeAsync`, through the shared queue)",
        "three r187 has dropped PCFSoftShadowMap",
        "The environment’s `sunShade` (cloud shadows) is read as each material is built",
        "Pull each branch spring toward the wind’s own bend, not toward rest with the wind as a force",
        "Step the springs in two half-frame substeps and hold a frame to 1/30 s",
        "Spring the bends, not the positions",
        "The springs and the analytic wind are the same formulas twice"
      ],
      "card": "entries/gpu-foliage.json"
    },
    {
      "id": "gpu-memory-ledger",
      "aliases": [],
      "name": "GPU memory ledger",
      "summary": "Find what fills VRAM in a three.js WebGPU app, and shrink it. Three small installable pieces, each one file that comes off again: a ledger that counts every texture and buffer where WebGPU makes it (bytes asked, bytes held, kind, and the object it was made for, named by the owners you give), a pool that packs three’s small per-object uniform, vertex and index buffers into 256-byte slices of 4 MB and 16 MB pages, and a fix that lets a dropped mesh with a shared material be collected with its buffers instead of kept forever by three’s listeners. Chrome on D3D12 rounds every resource under 4 MB up to the next power of two, at least 64 KB, so thousands of few-hundred-byte uniform buffers hold gigabytes: in the game it came from, a village of 38,892 objects held 3.65 GB for 561 MB of data, and 647 MB once pooled. The ledger runs nothing per frame (its report is worked out when asked); the demo, 1,500 meshes churning with textures and render targets swapped, costs what those meshes cost. Use it for scenes with thousands of meshes, streaming worlds that load and unload, leaks after a round trip, and memory budgets in perf tests. WebGPU only, on three r187 internals.",
      "category": "systems",
      "role": "tooling",
      "stack": [
        "three"
      ],
      "character": "calm",
      "tags": [
        "vram",
        "memory",
        "buffers",
        "uniform buffers",
        "pooling",
        "leaks",
        "garbage collection",
        "three internals",
        "webgpu"
      ],
      "useCases": [
        "finding what fills VRAM",
        "scenes with thousands of meshes",
        "streaming worlds that load and unload",
        "leaks after a round trip",
        "memory budgets and perf gates"
      ],
      "interaction": "Switch “Pool small buffers” on and watch Held fall to the data · add and remove things with the buttons",
      "kits": [],
      "pairsWith": [
        {
          "id": "segment-loader",
          "why": "Budgets from the bytes it counts"
        },
        {
          "id": "auto-instancer",
          "why": "See what instancing saves"
        },
        {
          "id": "perf-gates",
          "why": "Fail a run that leaks GPU memory"
        }
      ],
      "variants": [],
      "version": "1.0.2",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.80",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-03",
          "gpuMs": 0.632,
          "cpuMs": 5.843,
          "cpuP95Ms": 6.89,
          "badge": "heavy",
          "drawCalls": 1520,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with steady churn, pool on (uniforms, vertices, indices) and dispose events: 1,500 meshes (each its own geometry), four 1024² textures and two 1024² MSAA render targets; every half second 80 meshes leave and 80 arrive, every 2 s a texture is replaced and every 3 s a render target. The ledger panel updates four times a second, outside the frame. The cost is mostly the 1,500 draws: the ledger does nothing per frame, and HaTac measured the pool’s CPU per frame as no different past the noise."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 2.687,
          "cpuMs": 12.94,
          "cpuP95Ms": 24.58,
          "badge": "heavy",
          "drawCalls": 1520,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 1031 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 6.569,
          "cpuMs": 3.56,
          "cpuP95Ms": 4.66,
          "badge": "heavy",
          "drawCalls": 1600,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 588 ms."
        }
      ],
      "signatures": [
        {
          "file": "buffer-pool.ts",
          "declarations": "import type * as THREE from 'three/webgpu';\nimport type { PoolLedger } from './gpu-ledger';\nexport type PoolMode = 'off' | 'uniforms' | 'all';\nexport declare const POOL_MODES: readonly PoolMode[];\nexport declare const POOL_ALIGN = 256;\nexport declare const UNIFORM_PAGE: number;\nexport declare const ATTRIBUTE_PAGE: number;\nexport declare const ATTRIBUTE_MAX: number;\nexport declare const UNIFORM_MAX = 65536;\nexport declare const QUARANTINE_MS = 250;\ntype Range = {\n    page: PoolPage;\n    offset: number;\n    size: number;\n    bin: number;\n};\nexport declare class PoolPage<G = unknown> {\n    readonly byStart: Map<number, Range>;\n    readonly byEnd: Map<number, Range>;\n    used: number;\n    slices: number;\n    highWater: number;\n    dropped: boolean;\n    readonly gpu: G;\n    readonly size: number;\n    readonly index: number;\n    constructor(gpu: G, size: number, index: number);\n}\nexport type PoolSlot = {\n    page: PoolPage;\n    offset: number;\n    bytes: number;\n    size: number;\n    freed: boolean;\n    reused: boolean;\n};\ntype SlabOptions<G> = {\n    pageBytes: number;\n    align?: number;\n    makePage: (bytes: number, index: number) => G;\n    dropPage?: (gpu: G) => void;\n    quarantineMs?: number;\n    now?: () => number;\n};\nexport declare class SlabAllocator<G = unknown> {\n    readonly pages: PoolPage<G>[];\n    constructor(options: SlabOptions<G>);\n    get align(): number;\n    alloc(bytes: number): PoolSlot;\n    free(slot: PoolSlot): void;\n    drain(all?: boolean): void;\n    stats(): {\n        pages: number;\n        pageBytes: number;\n        slices: number;\n        askedBytes: number;\n        usedBytes: number;\n        freeBytes: number;\n        freeRanges: number;\n        quarantined: number;\n    };\n    dispose(): void;\n}\ntype GpuBuffer = {\n    size: number;\n    usage: number;\n    label: string;\n    destroy(): void;\n};\nexport declare class PooledBuffer {\n    readonly isPooledBuffer = true;\n    readonly slot: PoolSlot;\n    readonly size: number;\n    readonly usage: number;\n    readonly label: string;\n    constructor(pool: SlabAllocator<GpuBuffer>, slot: PoolSlot, queue: object, write: (...args: unknown[]) => void, size: number, usage: number, label: string, ledger: PoolLedger | null);\n    get page(): GpuBuffer;\n    get offset(): number;\n    getMappedRange(): ArrayBuffer;\n    unmap(): void;\n    destroy(): void;\n}\nexport declare function writtenBytes(data: ArrayBufferView | ArrayBuffer, dataOffset?: number, size?: number): number;\nexport type BufferPool = NonNullable<ReturnType<typeof poolSmallBuffers>>;\nexport declare function poolSmallBuffers(renderer: THREE.WebGPURenderer, options: {\n    mode: PoolMode;\n    ledger?: PoolLedger | null;\n}): {\n    mode: PoolMode;\n    stats: () => {\n        mode: PoolMode;\n        kinds: {\n            kind: string;\n            pages: number;\n            pageMb: number;\n            slices: number;\n            askedMb: number;\n            usedMb: number;\n            freeMb: number;\n            freeRanges: number;\n            quarantined: number;\n        }[];\n    } | null;\n    uninstall(): void;\n} | null;\nexport declare function bufferPoolStats(renderer: unknown): {\n    mode: PoolMode;\n    kinds: {\n        kind: string;\n        pages: number;\n        pageMb: number;\n        slices: number;\n        askedMb: number;\n        usedMb: number;\n        freeMb: number;\n        freeRanges: number;\n        quarantined: number;\n    }[];\n} | null;\nexport {};"
        },
        {
          "file": "gpu-ledger.ts",
          "declarations": "import type * as THREE from 'three/webgpu';\nexport declare function formatBlock(format: string): {\n    bytes: number;\n    w: number;\n    h: number;\n};\nexport declare function textureBytes(t: {\n    format: string;\n    width: number;\n    height: number;\n    depthOrArrayLayers?: number;\n    mipLevelCount?: number;\n    sampleCount?: number;\n    dimension?: string;\n}): number;\nexport declare function heldBytes(bytes: number): number;\nexport declare function bufferCategory(usage: number): \"vertex\" | \"storage\" | \"uniform\" | \"index\" | \"other\" | \"indirect\" | \"readback\";\ntype TextureLike = {\n    isTexture?: boolean;\n    name?: string;\n    image?: unknown;\n    source?: {\n        data?: unknown;\n    };\n    isRenderTargetTexture?: boolean;\n    isDepthTexture?: boolean;\n    isData3DTexture?: boolean;\n    isDataArrayTexture?: boolean;\n    isDataTexture?: boolean;\n    isCompressedTexture?: boolean;\n    isCanvasTexture?: boolean;\n    isStorageTexture?: boolean;\n    isCubeTexture?: boolean;\n    isFramebufferTexture?: boolean;\n    userData?: Record<string, unknown>;\n    renderTarget?: {\n        name?: string;\n    } | null;\n};\nexport declare function textureSource(texture: TextureLike | null, usage: number, dimension: string, layers: number): {\n    source: string;\n    name: string;\n};\nexport type LedgerEntry = {\n    id: number;\n    kind: 'texture' | 'buffer';\n    category: string;\n    source: string;\n    bytes: number;\n    held: number;\n    label: string;\n    site: string;\n    name: string;\n    format?: string;\n    size?: string;\n    mips?: number;\n    samples?: number;\n    usage: number;\n    chain: Array<WeakRef<object>> | null;\n    three: WeakRef<object> | null;\n    material: string;\n    createdAt: number;\n    freedAt: number;\n    freedBy: string;\n};\nexport type LedgerItem = {\n    id: number;\n    kind: string;\n    category: string;\n    source: string;\n    bytes: number;\n    held: number;\n    owner: string;\n    group: string;\n    site: string;\n    path?: string;\n    name: string;\n    label: string;\n    format?: string;\n    size?: string;\n    mips?: number;\n    samples?: number;\n    material: string;\n    createdAt: number;\n    freedAt: number;\n};\nexport type LedgerOwners = {\n    name: (object: object) => string | null;\n    group?: (owner: string, item: LedgerItem) => string;\n    scene?: {\n        traverse: (visit: (object: object) => void) => void;\n    } | null;\n};\nexport type PoolLedger = {\n    poolPage(page: object, name: string): void;\n    poolSlice(slice: object, page: object, bytes: number, held: number): void;\n    poolFree(slice: object): void;\n};\nexport type GpuLedger = ReturnType<typeof installGpuLedger>;\nexport type GpuLedgerReport = ReturnType<GpuLedger['report']>;\nexport declare function installGpuLedger(renderer: THREE.WebGPURenderer): {\n    report(owners?: LedgerOwners, options?: {\n        top?: number;\n        canvas?: {\n            width: number;\n            height: number;\n        } | null;\n        items?: boolean;\n    }): {\n        totalMb: number;\n        heldMb: number;\n        canvasMb: number;\n        count: number;\n        peakMb: number;\n        peakHeldMb: number;\n        peakAtS: number;\n        madeMb: number;\n        freedCount: number;\n        byCategory: {\n            name: string;\n            mb: number;\n            heldMb: number;\n            count: number;\n        }[];\n        textures: {\n            name: string;\n            mb: number;\n            heldMb: number;\n            count: number;\n        }[];\n        targets: {\n            name: string;\n            mb: number;\n            heldMb: number;\n            count: number;\n        }[];\n        byGroup: {\n            name: string;\n            mb: number;\n            heldMb: number;\n            count: number;\n        }[];\n        byGroupCategory: {\n            name: string;\n            mb: number;\n            heldMb: number;\n            count: number;\n        }[];\n        byOwner: {\n            name: string;\n            mb: number;\n            heldMb: number;\n            count: number;\n        }[];\n        peak: {\n            byCategory: {\n                name: string;\n                mb: number;\n                heldMb: number;\n                count: number;\n            }[];\n            byGroup: {\n                name: string;\n                mb: number;\n                heldMb: number;\n                count: number;\n            }[];\n        };\n        top: {\n            mb: number;\n            heldMb: number;\n            category: string;\n            source: string;\n            owner: string;\n            name: string;\n            format: string | undefined;\n            size: string | undefined;\n            mips: number | undefined;\n            samples: number | undefined;\n            material: string;\n        }[];\n        items: LedgerItem[] | undefined;\n    };\n    stats(): {\n        liveMb: number;\n        heldMb: number;\n        count: number;\n        peakMb: number;\n        peakHeldMb: number;\n        madeMb: number;\n    };\n    ownerOf(id: number): object | null;\n    resetPeak(): void;\n    uninstall(): void;\n    poolPage(page: object, name: string): void;\n    poolSlice(slice: object, page: object, bytes: number, held: number): void;\n    poolFree(slice: object): void;\n};\nexport {};"
        },
        {
          "file": "weak-render-objects.ts",
          "declarations": "import type * as THREE from 'three/webgpu';\ntype Dispatcher = {\n    addEventListener(type: string, listener: (event: unknown) => void): void;\n    removeEventListener(type: string, listener: (event: unknown) => void): void;\n};\ntype RenderObjectLike = {\n    material: Dispatcher;\n    geometry: Dispatcher;\n    _sourceMaterial: Dispatcher | null;\n    lightsNode?: Dispatcher | null;\n    onMaterialDispose: (event?: unknown) => void;\n    onGeometryDispose: (event?: unknown) => void;\n    onLightsNodeDispose?: (event?: unknown) => void;\n    geometryDisposed?: (event?: unknown) => void;\n    dispose(): void;\n    attributes: unknown;\n    attributesId: unknown;\n};\nexport declare function weakenListeners(renderObject: RenderObjectLike): void;\nexport declare class WeakTally<V> {\n    get(key: object): V | undefined;\n    set(key: object, value: V): this;\n    has(key: object): boolean;\n    delete(key: object): boolean;\n    clear(): void;\n}\nexport declare class WeakBindGroups<T extends object> {\n    add(group: T): this;\n    has(group: T): boolean;\n    delete(group: T): boolean;\n    clear(): void;\n    get size(): number;\n    [Symbol.iterator](): Generator<T, void, unknown>;\n}\nexport declare function weakRenderObjects(renderer: THREE.WebGPURenderer): {\n    uninstall(): void;\n} | null;\nexport {};"
        }
      ],
      "pitfalls": [
        "All three hook three r187 internals (each file names what it touches)",
        "“Held” is a model of Chrome’s Dawn on D3D12",
        "Install order matters: the ledger, then the pool (given the ledger), then the leak fix",
        "A reused pool slice must be zeroed",
        "The pool’s uninstall() drops its pages",
        "Dropping a mesh whose material or geometry is shared leaks it in three",
        "Three frees a pipeline when the last render object using it goes",
        "WebGPU only, by design: on three’s WebGL2 backend there is no device to hook",
        "Pooling changes no shader or layout, but a write past a slice would land in its neighbour’s"
      ],
      "card": "entries/gpu-memory-ledger.json"
    },
    {
      "id": "gpu-page-runtime",
      "aliases": [],
      "name": "GPU page runtime",
      "summary": "Many small WebGPU widgets on one page share one device, one command encoder and one submit a frame. Each widget is a frame task that sleeps on its own: when it has nothing new to draw, when it is scrolled out of view (one IntersectionObserver) or while the tab is hidden, so an idle page costs nothing. Pipelines compile in the background and draws wait for them; WGSL errors name their chunk and line; a lost device drops every widget to its CSS fallback and a new one is asked for; GPU colours come from CSS tokens and follow a theme change. One shared overlay canvas sleeps, hidden, while nothing in it is alive.",
      "category": "systems",
      "role": "system",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "calm",
      "tags": [
        "raw webgpu",
        "wgsl",
        "frame loop",
        "draw on demand",
        "intersectionobserver",
        "visibilitychange",
        "device lost",
        "createRenderPipelineAsync",
        "css tokens",
        "theming",
        "timestamp queries",
        "fallback",
        "dashboards",
        "no dependencies"
      ],
      "useCases": [
        "dashboards with many small charts and gauges",
        "GPU sparklines, meters and cards in an ordinary page",
        "design systems whose components draw with WebGPU",
        "one overlay for effects that belong to no element",
        "surviving a lost GPU device on phones and laptops",
        "GPU colours that follow the page’s light and dark themes"
      ],
      "interaction": "Scroll the page and watch widgets sleep · Lose the device · Break a shader · Switch the accent",
      "kits": [],
      "pairsWith": [
        {
          "id": "capability-tiers",
          "why": "One tier for every widget on the page"
        },
        {
          "id": "gpu-memory-ledger",
          "why": "Count the shared device’s bytes"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 0.203,
          "cpuMs": 1.43,
          "cpuP95Ms": 2.425,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the demo running itself: new data every 0.5 s for the three line charts and the gauge, a pointer sweeping the glow card, the bars’ highlight stepping, the backup ring running and a flare on the overlay every 1.5 s. The throughput chart scrolls in and out of view. GPU time is every pass of the frame (one per awake canvas), from timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.262,
          "cpuMs": 0.927,
          "cpuP95Ms": 2.74,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.66,
            "p99Ms": 18.09,
            "low1Fps": 50.3
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 72 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 2.843,
          "cpuMs": 1.88,
          "cpuP95Ms": 3.7,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 255 ms."
        }
      ],
      "signatures": [
        {
          "file": "overlay.ts",
          "declarations": "import type { GpuContext, GpuRuntime, Pipeline } from './runtime';\nimport type { ColourSpec } from './theme';\nimport type { Rgba } from './colour';\nexport type OverlayFrame<R> = {\n    t: number;\n    dt: number;\n    width: number;\n    height: number;\n    dpr: number;\n    motion: 0 | 1;\n    res: R;\n    colours: Record<string, Rgba>;\n    origin: {\n        left: number;\n        top: number;\n    };\n    ready(...pipelines: Pipeline[]): boolean;\n};\nexport type OverlayLayer<R> = {\n    label: string;\n    setup(gpu: GpuContext, runtime: GpuRuntime): R;\n    alive(t: number): boolean;\n    draw(pass: GPURenderPassEncoder, frame: OverlayFrame<R>): void;\n};\nexport type OverlayOptions = {\n    container?: HTMLElement;\n    zIndex?: number;\n    colours?: ColourSpec;\n    colourAt?: Element;\n};\nexport type Overlay = {\n    add<R>(layer: OverlayLayer<R>): {\n        wake(): void;\n        remove(): void;\n    };\n    wake(): void;\n    readonly shown: boolean;\n    readonly canvas: HTMLCanvasElement;\n    dispose(): void;\n};\nexport declare function createOverlay(runtime: GpuRuntime, options?: OverlayOptions): Overlay;"
        },
        {
          "file": "runtime.ts",
          "declarations": "import { type TaskState } from './schedule';\nimport { type WgslChunk } from './wgsl-errors';\nimport { type ColourSpec } from './theme';\nimport type { Rgba } from './colour';\nexport type GpuContext = {\n    readonly device: GPUDevice;\n    readonly format: GPUTextureFormat;\n    readonly generation: number;\n    readonly timed: boolean;\n    readonly adapter: string;\n};\nexport type RuntimeStatus = 'starting' | 'on' | 'lost' | 'unsupported' | 'failed' | 'disposed';\nexport type RuntimeOptions = {\n    root?: HTMLElement;\n    classes?: {\n        on: string;\n        off: string;\n    } | false;\n    device?: GPUDevice;\n    requestDevice?: () => Promise<GPUDevice | null>;\n    powerPreference?: GPUPowerPreference;\n    loop?: 'auto' | 'manual';\n    retry?: {\n        delay?: number;\n        attempts?: number;\n    };\n    themeAttributes?: string[];\n    dprCap?: number;\n    timestamps?: boolean;\n    motion?: 'auto' | boolean;\n    onError?: (message: string) => void;\n};\nexport type Binding = 'uniform' | 'storage' | 'texture' | 'sampler';\nexport type Blend = 'premul' | 'add' | 'none';\nexport type PipelineDesc = {\n    label?: string;\n    code: string | WgslChunk[];\n    bindings?: Binding[];\n    blend?: Blend;\n    topology?: GPUPrimitiveTopology;\n    vertex?: string;\n    fragment?: string;\n};\nexport type Pipeline = {\n    readonly key: string;\n    readonly ready: boolean;\n    readonly failed: boolean;\n    readonly layout: GPUBindGroupLayout;\n    bind(resources: Array<GPUBuffer | GPUTextureView | GPUSampler>): GPUBindGroup;\n    draw(pass: GPURenderPassEncoder, group: GPUBindGroup, vertices: number, instances?: number): boolean;\n};\nexport type WidgetState = TaskState | 'waiting' | 'failed';\nexport type WidgetFrame<R> = {\n    t: number;\n    dt: number;\n    gpu: GpuContext;\n    res: R;\n    width: number;\n    height: number;\n    dpr: number;\n    motion: 0 | 1;\n    colours: Record<string, Rgba>;\n    encoder: GPUCommandEncoder;\n    ready(...pipelines: Pipeline[]): boolean;\n    pass(clear?: GPUColor): GPURenderPassEncoder;\n};\nexport type WidgetSpec<R> = {\n    label: string;\n    canvas: HTMLCanvasElement;\n    watch?: Element | false;\n    mark?: Element | false;\n    colours?: ColourSpec;\n    colourAt?: Element;\n    size?: () => {\n        width: number;\n        height: number;\n    };\n    dprCap?: number;\n    setup(gpu: GpuContext, runtime: GpuRuntime): R;\n    draw(frame: WidgetFrame<R>): {\n        idle?: boolean;\n    } | void;\n    teardown?(res: R): void;\n};\nexport type GpuWidget = {\n    readonly label: string;\n    readonly state: WidgetState;\n    readonly frames: number;\n    wake(): void;\n    rebuild(): void;\n    dispose(): void;\n};\nexport type RuntimeStats = {\n    readonly status: RuntimeStatus;\n    readonly generation: number;\n    readonly ticks: number;\n    readonly submitted: number;\n    readonly skipped: number;\n    readonly drawsSkipped: number;\n    readonly pipelines: {\n        ready: number;\n        pending: number;\n        failed: number;\n    };\n    readonly errors: readonly string[];\n    readonly attempt: number;\n    readonly retryAt: number;\n};\nexport type GpuRuntime = {\n    readonly ready: Promise<GpuContext | null>;\n    readonly gpu: GpuContext | null;\n    readonly status: RuntimeStatus;\n    widget<R>(spec: WidgetSpec<R>): GpuWidget;\n    pipeline(key: string, desc: PipelineDesc): Pipeline;\n    shader(label: string, code: string | WgslChunk[]): GPUShaderModule;\n    now(): number;\n    motion(): 0 | 1;\n    setMotion(motion: 'auto' | boolean): void;\n    paused: boolean;\n    sleepOffscreen: boolean;\n    frame(ms?: number): void;\n    themeChanged(): void;\n    onDevice(fn: (gpu: GpuContext | null) => void): () => void;\n    loseDevice(): void;\n    retryNow(): void;\n    widgets(): ReadonlyArray<{\n        label: string;\n        state: WidgetState;\n        frames: number;\n    }>;\n    readonly stats: RuntimeStats;\n    gpuTime(): number | null;\n    dispose(): void;\n};\nexport declare function createGpuRuntime(options?: RuntimeOptions): GpuRuntime;"
        }
      ],
      "pitfalls": [
        "One device for the page, or nothing is shared",
        "A lost device takes everything made on it",
        "After a loss, ask a new adapter",
        "device.destroy() reports the loss with reason \"destroyed\", the same as your own dispose()",
        "IntersectionObserver ignores display",
        "A widget that skips its draw while a pipeline compiles stays awake",
        "getComputedStyle gives a custom property’s text as written, with var() filled in",
        "The theme watcher sees attributes, not stylesheets",
        "A canvas that changes size is cleared",
        "Timestamp queries need the timestamp-query feature, which not every browser and adapter offer"
      ],
      "card": "entries/gpu-page-runtime.json"
    },
    {
      "id": "gpu-particles",
      "aliases": [],
      "name": "GPU particles with collisions and emitters",
      "summary": "A general compute-particle core: emitters as plain data, noise turbulence, buoyancy and vortex forces, particles that bounce, slide or stick on floors and boxes, child emitters spawned on the GPU, and 14 shapes drawn without textures. One draw a layer for every effect at once.",
      "category": "particles",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "expressive",
      "tags": [
        "compute",
        "vfx",
        "emitters",
        "sub-emitters",
        "collision",
        "noise",
        "procedural sprites",
        "instancing",
        "tsl"
      ],
      "useCases": [
        "sparks, fire and smoke",
        "fireworks and magic",
        "rain with splashes",
        "falling petals and leaves",
        "debris that stays",
        "impacts and blood that stick"
      ],
      "interaction": "Pick an effect · click or tap the floor or a box to burst there · drag to orbit",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "ring-effects",
          "why": "Streaks and marks beside the particles"
        },
        {
          "id": "rain-snow",
          "why": "Weather from a stateless cousin"
        },
        {
          "id": "compile-without-stalls",
          "why": "Wind and time shared with every material"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 0.842,
          "cpuMs": 0.28,
          "cpuP95Ms": 0.455,
          "badge": "moderate",
          "drawCalls": 12,
          "computeDispatches": 3,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.625,
            "p99Ms": 6.85,
            "low1Fps": 138.6
          },
          "notes": "Measured on the Fireworks preset at rate ×3: a shell about every 0.3 s, each shell’s 12 particles bursting into 192 stars on the GPU (a sub-emitter on death) that bounce on the floor and boxes, and a flash light timed to each burst. Only the glow layer is alive, so only it simulates and draws."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 2.556,
          "cpuMs": 0.825,
          "cpuP95Ms": 1.3,
          "badge": "heavy",
          "drawCalls": 12,
          "computeDispatches": 3,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 1371 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 2.096,
          "cpuMs": 0.08,
          "cpuP95Ms": 0.1,
          "badge": "heavy",
          "drawCalls": 12,
          "computeDispatches": 3,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 511 ms."
        }
      ],
      "signatures": [
        {
          "file": "collision-field.ts",
          "declarations": "export interface PropBox {\n    x: number;\n    y: number;\n    z: number;\n    halfX: number;\n    halfY: number;\n    halfZ: number;\n    cos: number;\n    sin: number;\n}\nexport interface WallSegment {\n    ax: number;\n    az: number;\n    bx: number;\n    bz: number;\n    y0: number;\n    y1: number;\n    halfThickness?: number;\n}\nexport interface Slab {\n    polygon: Array<{\n        x: number;\n        z: number;\n    }>;\n    y: number;\n    holes?: Array<Array<{\n        x: number;\n        z: number;\n    }>>;\n}\nexport interface Colliders {\n    walls: WallSegment[];\n    slabs: Slab[];\n    boxes: PropBox[];\n}\nexport declare const FLOOR_LAYERS = 4;\nexport declare const GRID_SLOTS = 12;\nexport declare const MAX_FIELD_BOXES = 2048;\nexport declare const NO_FLOOR = -1000000;\nexport type CollisionField = {\n    originX: number;\n    originZ: number;\n    resolution: number;\n    cell: number;\n    floors: Float32Array;\n    boxes: Float32Array;\n    boxCount: number;\n    gridResolution: number;\n    gridCell: number;\n    grid: Int32Array;\n};\nexport type FieldSource = {\n    heightAt: (x: number, z: number) => number;\n    colliders: Colliders;\n};\nexport declare function wallBox(wall: Colliders['walls'][number]): PropBox;\nexport declare function buildCollisionField(source: FieldSource, centerX: number, centerZ: number, size?: number, resolution?: number, gridResolution?: number): CollisionField;\nexport declare function buildCollisionFieldSteps(source: FieldSource, centerX: number, centerZ: number, size?: number, resolution?: number, gridResolution?: number): Generator<void, CollisionField>;\nexport declare function floorBelow(field: CollisionField, x: number, y: number, z: number): number;"
        },
        {
          "file": "emitter.ts",
          "declarations": "export declare const PARTICLE_SHAPES: readonly [\n    \"soft\",\n    \"smoke\",\n    \"flame\",\n    \"spark\",\n    \"droplet\",\n    \"goo\",\n    \"shard\",\n    \"ring\",\n    \"glint\",\n    \"square\",\n    \"petal\",\n    \"leaf\",\n    \"needle\",\n    \"frond\"\n];\nexport type ParticleShape = (typeof PARTICLE_SHAPES)[number];\nexport declare const PARTICLE_BLENDS: readonly [\n    \"additive\",\n    \"alpha\",\n    \"solid\"\n];\nexport type ParticleBlend = (typeof PARTICLE_BLENDS)[number];\nexport declare const SPAWN_SHAPES: readonly [\n    \"point\",\n    \"sphere\",\n    \"hemisphere\",\n    \"disc\",\n    \"ring\",\n    \"box\",\n    \"line\"\n];\nexport type SpawnShape = (typeof SPAWN_SHAPES)[number];\nexport type Emitter = {\n    blend: ParticleBlend;\n    shape: ParticleShape;\n    count: number;\n    window: number;\n    spawnShape: SpawnShape;\n    radius: number;\n    speedMin: number;\n    speedMax: number;\n    spread: number;\n    radial: boolean;\n    inherit: number;\n    lifeMin: number;\n    lifeMax: number;\n    gravity: number;\n    drag: number;\n    wind: number;\n    buoyancy: number;\n    cooling: number;\n    curl: number;\n    curlScale: number;\n    curlSpeed: number;\n    vortex: number;\n    collide: boolean;\n    bounce: number;\n    friction: number;\n    stick: number;\n    size: [\n        number,\n        number,\n        number\n    ];\n    sizeJitter: number;\n    colors: [\n        string,\n        string,\n        string\n    ];\n    colorJitter: number;\n    glow: number;\n    fadeIn: number;\n    fadeOut: number;\n    opacity: number;\n    stretch: number;\n    spin: number;\n    wobble: number;\n    flutter: number;\n    lighting: number;\n    softness: number;\n    persist: boolean;\n    subTrigger: SubTrigger;\n    subCount: number;\n    sub: Emitter | null;\n};\nexport declare const MAX_EMITTER_COUNT = 50000;\nexport declare const SUB_TRIGGERS: readonly [\n    \"none\",\n    \"contact\",\n    \"death\"\n];\nexport type SubTrigger = (typeof SUB_TRIGGERS)[number];\nexport declare const DEFAULT_EMITTER: Emitter;\nexport declare function parseEmitter(value: unknown, base?: Emitter, nested?: boolean): Emitter;\nexport declare const STYLE_ROWS = 12;\nexport declare const MAX_CHILDREN = 16;\nexport declare const LAYER_IDS: Record<ParticleBlend, number>;\nexport declare function packStyle(e: Emitter, child?: number): Float32Array;\nexport declare function styleKey(e: Emitter): string;"
        },
        {
          "file": "particle-world.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\nimport { type Emitter, type ParticleBlend } from './emitter';\nimport { type CollisionField, type PropBox } from './collision-field';\nexport declare const PARTICLE_CAPACITY: Record<ParticleBlend, number>;\nexport type SpawnRequest = {\n    emitter: Emitter;\n    origin: [\n        number,\n        number,\n        number\n    ];\n    axis: [\n        number,\n        number,\n        number\n    ];\n    velocity?: [\n        number,\n        number,\n        number\n    ];\n    groundY?: number;\n    countScale?: number;\n    sizeScale?: number;\n    speedScale?: number;\n    radiusScale?: number;\n    delay?: number;\n    seed?: number;\n};\nexport type ParticleOptions = {\n    capacity?: Partial<Record<ParticleBlend, number>>;\n    fogPosition?: (material: THREE.NodeMaterial, worldPosition: Node<'vec3'>) => void;\n};\nexport declare class ParticleWorld {\n    readonly object3D: THREE.Group<THREE.Object3DEventMap>;\n    constructor(options?: ParticleOptions);\n    setField(field: CollisionField | null): void;\n    setLighting(toSun: THREE.Vector3, sunColor: THREE.Color, ambient: THREE.Color): void;\n    setPixelsPerMetre(pixels: number): void;\n    setMovers(boxes: readonly PropBox[]): void;\n    warm(renderer: THREE.WebGPURenderer, camera?: THREE.Camera, scene?: THREE.Scene): Promise<void>;\n    setDebris(debris: {\n        keep: boolean;\n        pieces: number;\n        shadows: boolean;\n    }): void;\n    clear(): void;\n    spawn(request: SpawnRequest): void;\n    update(renderer: THREE.WebGPURenderer, dt: number, wind?: THREE.Vector3): void;\n    debugRead(renderer: THREE.WebGPURenderer, blend: ParticleBlend): Promise<{\n        position: Float32Array<ArrayBuffer>;\n        velocity: Float32Array<ArrayBuffer>;\n        look: Float32Array<ArrayBuffer>;\n        ground: Float32Array<ArrayBuffer>;\n    }>;\n    debugEvents(renderer: THREE.WebGPURenderer): Promise<{\n        count: number;\n        first: number[];\n    }>;\n    stats(): {\n        styles: number;\n        spawned: number;\n        live: (\"alpha\" | \"solid\" | \"additive\")[];\n    };\n    dispose(): void;\n}"
        }
      ],
      "pitfalls": [
        "The demo needs WebGPU, and so does the module",
        "TSL: an `If(cond, () => x.assign(y))` arrow that returns a node is a return and ends the whole…",
        "Round an interpolated style index (`+ 0.5`) before `toInt()`",
        "WebGPU allows 8 storage buffers a stage by default",
        "A floor cell’s empty heights must read as no floor (NO_FLOOR, checked)",
        "Every shape fades out before its quad’s border",
        "Give the sprite geometry its normal attribute from the start and draw it single-pass",
        "Hidden layers are skipped by compileAsync",
        "A batch first drawn with no instances draws nothing later",
        "Sprites are placed in vertexNode, so three’s fog sees the quad, not the particle",
        "The turbulence is vector noise, not divergence-free curl noise",
        "Soft edges fade by height above the floor under each particle, not by the depth buffer"
      ],
      "card": "entries/gpu-particles.json"
    },
    {
      "id": "gravity-lens",
      "aliases": [],
      "name": "A gravitational lens behind the page",
      "summary": "Elements on the page are masses that bend a procedural deep sky behind them: each [data-mass] box is a thin lens whose pull follows its shape, gains weight while pointed at, focused or thrown, and closes the light behind it into an Einstein ring. A Schwarzschild black hole sits in the open space, with a real photon march near it (its accretion disk, the far side lensed over the top, the photon ring) and the weak-field angle 2 rs/b further out; bodies on Kepler orbits round it, solved on the GPU with their light trails; a space-time fabric that dips under every mass; gravitational-wave ripples; and the panels drawn as frosted glass over the bent light. One full-screen raw WebGPU pass and a few small ones, compiled ahead, resting when nothing moves.",
      "category": "post",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "gravitational lensing",
        "black hole",
        "schwarzschild",
        "einstein ring",
        "kepler orbits",
        "dom + gpu",
        "glass",
        "frosted glass",
        "space",
        "backdrop",
        "showpiece",
        "data",
        "raw webgpu",
        "wgsl",
        "compute",
        "procedural sky",
        "fling",
        "draw on demand",
        "timestamp queries",
        "no dependencies"
      ],
      "useCases": [
        "a backdrop that answers the page: cards bend the sky behind them",
        "a hero section or splash that rewards pointing and throwing",
        "a data story where the total is a black hole and the parts orbit it",
        "teaching lensing, Einstein rings and Kepler’s laws",
        "frosted glass panels over a live GPU picture",
        "a space scene for a game menu or a loading screen"
      ],
      "interaction": "Drag the sky to turn it · point at a card to make it heavier, or throw it · click the sky for a wave, a body or a row to pick it",
      "kits": [],
      "pairsWith": [
        {
          "id": "capability-tiers",
          "why": "Pick its tier before the first frame"
        },
        {
          "id": "effects-switchboard",
          "why": "Let people turn the moving sky off"
        },
        {
          "id": "dynamic-resolution",
          "why": "Hold the frame budget behind the page"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "The sky at 0.85 of the pixel ratio.",
          "low": "The sky at 0.6 of the pixel ratio: about a third of the pixels."
        },
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-13",
          "gpuMs": 2.776,
          "cpuMs": 0.41,
          "cpuP95Ms": 0.58,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Six bodies on Kepler orbits round the black hole (photon march, disk, photon ring), three card lenses and the table panel as glass, the fabric on, the camera turning slowly and a wave every two seconds; at the stage’s size and pixel ratio, timed with its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 5.439,
          "cpuMs": 0.82,
          "cpuP95Ms": 1.135,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.682,
            "p99Ms": 17.845,
            "low1Fps": 55.8
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 357 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 8.066,
          "cpuMs": 1.38,
          "cpuP95Ms": 1.68,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 83 ms."
        }
      ],
      "signatures": [
        {
          "file": "camera.ts",
          "declarations": "export type Mat4 = Float32Array;\nexport type Vec3 = [\n    number,\n    number,\n    number\n];\nexport declare function perspective(fovY: number, aspect: number, near: number, far: number): Mat4;\nexport declare function lookAt(eye: Vec3, at: Vec3, up?: Vec3): Mat4;\nexport declare function mul(a: Mat4, b: Mat4): Mat4;\nexport declare function invert(a: Mat4): Mat4;\nexport type OrbitView = {\n    yaw: number;\n    pitch: number;\n    dist: number;\n    target?: Vec3;\n    fov?: number;\n    shift?: [\n        number,\n        number\n    ];\n};\nexport type OrbitCam = {\n    eye: Vec3;\n    vp: Mat4;\n    ivp: Mat4;\n    focal: number;\n    w: number;\n    h: number;\n};\nexport declare function orbitCamera({ yaw, pitch, dist, target, fov, shift }: OrbitView, w: number, h: number): OrbitCam;\nexport declare function project(cam: OrbitCam, p: Vec3): [\n    number,\n    number,\n    number\n] | null;\nexport declare function screenToPlane(cam: OrbitCam, x: number, y: number, planeY: number): [\n    number,\n    number,\n    number\n] | null;"
        },
        {
          "file": "dom-masses.ts",
          "declarations": "import { type GlassPanel, type LensMass, type Rgb } from './masses';\nexport type DomMassOptions = {\n    canvas: HTMLElement;\n    selector?: string;\n    colors?: Record<string, Rgb>;\n    speedOf?: (el: HTMLElement) => {\n        speed: number;\n        dragged: boolean;\n    } | null;\n};\nexport type DomMassFrame = {\n    masses: LensMass[];\n    panels: GlassPanel[];\n    moving: boolean;\n};\nexport type DomMasses = {\n    read(dt: number, opts?: {\n        lensing?: number;\n        motion?: boolean;\n    }): DomMassFrame;\n    readonly active: HTMLElement | null;\n    dispose(): void;\n};\nexport declare function createDomMasses(container: HTMLElement, { canvas, selector, colors, speedOf }: DomMassOptions): DomMasses;"
        },
        {
          "file": "fling.ts",
          "declarations": "export type FlingBody = {\n    x: number;\n    y: number;\n    vx: number;\n    vy: number;\n    speed: number;\n    moving: boolean;\n};\nexport declare function stepFling(b: FlingBody, dt: number, k?: number, c?: number): void;\nexport declare function releaseVelocity(hist: ReadonlyArray<readonly [\n    number,\n    number,\n    number\n]>, now: number, x: number, y: number, cap?: number): [\n    number,\n    number\n];\nexport type FlingOptions = {\n    onTap?: (e: PointerEvent) => void;\n    motion?: () => boolean;\n    stiffness?: number;\n    damping?: number;\n    keyPush?: number;\n};\nexport type Flings = {\n    add(el: HTMLElement, options?: FlingOptions): void;\n    remove(el: HTMLElement): void;\n    step(dt: number): boolean;\n    state(el: HTMLElement): (FlingBody & {\n        held: boolean;\n        dragged: boolean;\n    }) | null;\n    home(): void;\n    dispose(): void;\n};\nexport declare function createFlings(): Flings;"
        },
        {
          "file": "gravity-lens.ts",
          "declarations": "import { type OrbitCam, type OrbitView } from './camera';\nimport type { Orbit } from './kepler';\nimport { MAX_MASSES, MAX_PANELS, type GlassPanel, type LensMass, type Rgb } from './masses';\nimport { MAX_BODIES, MAX_RIPPLES } from './lens-wgsl';\nexport { MAX_BODIES, MAX_MASSES, MAX_PANELS, MAX_RIPPLES };\nexport type HoleSettings = {\n    rs: number;\n    visible?: number;\n    inner?: number;\n    outer?: number;\n    disk?: number;\n    galaxy?: number;\n    march?: number;\n};\nexport type LensPost = {\n    exposure?: number;\n    bloom?: number;\n    vignette?: number;\n    grain?: number;\n    contrast?: number;\n};\nexport type Ripple = {\n    x: number;\n    y: number;\n    age: number;\n    amp: number;\n};\nexport type LensFrame = {\n    camera: OrbitView;\n    time: number;\n    orbitTime?: number;\n    hole?: HoleSettings | null;\n    look?: 'deep' | 'paper';\n    lensing?: number;\n    chroma?: number;\n    fabric?: number;\n    waves?: number;\n    ripples?: readonly Ripple[];\n    orbits?: number;\n    trail?: number;\n    sky?: {\n        nebula?: number;\n        stars?: number;\n        galaxies?: number;\n        twinkle?: number;\n    };\n    accent?: Rgb;\n    accent2?: Rgb;\n    post?: LensPost;\n    seed?: number;\n};\nexport type LensFrameInfo = {\n    cam: OrbitCam;\n    hole: {\n        x: number;\n        y: number;\n        shadow: number;\n    } | null;\n    drawn: boolean;\n};\nexport type GravityLens = {\n    device: GPUDevice;\n    setMasses(list: readonly LensMass[]): void;\n    setOrbits(list: readonly Orbit[]): void;\n    setPanels(list: readonly GlassPanel[]): void;\n    resize(width: number, height: number, dpr: number): void;\n    frame(f: LensFrame): LensFrameInfo | null;\n    camera(view: OrbitView): OrbitCam;\n    gpuMs(): number | null;\n    readonly lost: boolean;\n    onLost: ((reason: string) => void) | null;\n    dispose(): void;\n};\nexport type LensTier = 'high' | 'medium' | 'low';\nexport declare const LENS_TIER: Record<LensTier, number>;\nexport type GravityLensOptions = {\n    device?: GPUDevice;\n    tier?: LensTier;\n    onError?: (message: string) => void;\n};\nexport declare function createGravityLens(canvas: HTMLCanvasElement, { device: given, onError, tier }?: GravityLensOptions): Promise<GravityLens | null>;"
        },
        {
          "file": "kepler.ts",
          "declarations": "import type { Vec3 } from './camera';\nexport type Orbit = {\n    a: number;\n    e: number;\n    n: number;\n    m0: number;\n    w: number;\n    inc: number;\n    size: number;\n    color: [\n        number,\n        number,\n        number\n    ];\n    highlight?: number;\n    visible?: boolean;\n};\nexport declare function solveKepler(M: number, e: number, steps?: number): number;\nexport declare function keplerAt(o: Pick<Orbit, 'a' | 'e' | 'n' | 'm0' | 'w' | 'inc'>, t: number, centre?: Vec3): Vec3;\nexport declare const period: (o: Pick<Orbit, \"n\">) => number;\nexport declare function orbitPath(o: Pick<Orbit, 'a' | 'e' | 'w' | 'inc'>, segments?: number, centre?: Vec3): Vec3[];"
        }
      ],
      "pitfalls": [
        "The page’s boxes bend the sky in screen space, the hole in three dimensions",
        "Mass from a box: a little for its size, more for its rest mass",
        "The march runs only inside a sphere of 10 rs round the hole (march)",
        "Read every [data-mass] rect in the same frame you draw, from the canvas’s own top left",
        "A [data-glass] element must be transparent",
        "Labels pinned to bodies must hide behind the hole",
        "Rest when nothing moves: hold `time` and `seed` still, stop the orbit clock",
        "frame() skips a frame while the last is still on the GPU (`drawn` false)",
        "The paper look subtracts its lines and dust (reverse-subtract blending)",
        "Ripples, the dust and the glass edges are sized in CSS px and scaled by the pixel ratio",
        "On a weak GPU pass `tier` (LENS_TIER)",
        "The canvas takes pan-y touches, so a vertical swipe still scrolls the page on a phone and only…",
        "A WebGPU device can be lost (a driver reset, a sleeping laptop)",
        "The canvas is kept within the device’s largest texture (8192 px on most)"
      ],
      "card": "entries/gravity-lens.json"
    },
    {
      "id": "grid-oscillators",
      "aliases": [],
      "name": "Coupled oscillators on the GPU",
      "summary": "Thousands of oscillators that pull each other into step, simulated in compute and drawn from the same buffers. Every node obeys the swing equation (Kuramoto with inertia): a power grid of 4,096 nodes on a generated island, stepped 32 times a frame, with governors, secondary control, under-frequency load shedding, lines that heat and trip, and nodes that drop out. A reduction gives the order parameter. A synchroscope wheel puts each node at its phase against the nominal clock and at a radius set by its frequency, with coherence as the needle; the map carries a beat along every line in the direction power flows. The same shader runs fireflies in a meadow and metronomes on boards, with all-to-all coupling for the price of one sum. A CPU twin does the same arithmetic and draws in Canvas 2D where WebGPU is missing.",
      "category": "simulation",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "coupled oscillators",
        "kuramoto",
        "swing equation",
        "synchronisation",
        "order parameter",
        "power grid",
        "frequency",
        "inertia",
        "load shedding",
        "fireflies",
        "metronomes",
        "synchroscope",
        "network",
        "csr graph",
        "compute shader",
        "reduction",
        "raw webgpu",
        "wgsl",
        "cpu twin",
        "canvas 2d fallback",
        "timestamp queries",
        "no dependencies"
      ],
      "useCases": [
        "a live grid-frequency or control-room view that explains why inertia and reserves matter",
        "teaching synchronisation: fireflies, metronomes, pacemaker cells, clapping audiences",
        "any network whose nodes keep a rhythm and pull on their neighbours (clocks, generators, agents)",
        "a \"what if this line opens\" exploration on a network of your own",
        "a calm, living background whose nodes pulse at their own phases and drift into step"
      ],
      "interaction": "Trip a unit or open a line and watch the wheel · click the inset to swap views · on Fireflies, slide the coupling",
      "kits": [],
      "pairsWith": [
        {
          "id": "compute-gallery",
          "why": "More compute techniques shown the same way"
        },
        {
          "id": "quiet-charts",
          "why": "Frequency and load as plain charts"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [
        {
          "name": "calm",
          "in": "module",
          "values": {
            "strict": true
          },
          "note": "every pulse held still"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-14",
          "gpuMs": 0.935,
          "cpuMs": 0.115,
          "cpuP95Ms": 0.175,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured on the power grid: 4,096 nodes, 32 steps a frame of the swing equation, the lines and the order parameter in compute, the map and the wheel inset drawn from the same buffers, timed by timestamp queries. A nuclear unit trips a second in, so the frames show a swing, governors and secondary control."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 2.359,
          "cpuMs": 0.25,
          "cpuP95Ms": 0.385,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 1131 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 6.627,
          "cpuMs": 0.22,
          "cpuP95Ms": 0.28,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 805 ms."
        }
      ],
      "signatures": [
        {
          "file": "control.ts",
          "declarations": "import { type Figures, type Limits, type Network, type SimState } from './model';\nexport type GridEvent = {\n    t: number;\n    kind: 'trip' | 'line' | 'dark' | 'shed' | 'ok' | 'act';\n    text: string;\n    sev: 0 | 1 | 2 | 3;\n};\nexport type Incident = {\n    what: string;\n    at: number;\n    nadir: number;\n    peak: number;\n    maxRocof: number;\n    recovered: boolean;\n    recoveredAfter?: number;\n};\nexport type ControlOptions = {\n    f0: number;\n    limits: Limits;\n    agcGain: number;\n    agcHead: number;\n    lineName(k: number): string;\n    unitName(i: number): string | null;\n};\nexport type Control = {\n    readonly agc: number;\n    readonly rocof: number;\n    readonly incident: Incident | null;\n    readonly history: ReadonlyArray<{\n        t: number;\n        f: number;\n    }>;\n    readonly events: ReadonlyArray<GridEvent>;\n    read(F: Figures, st: SimState, t: number): GridEvent[];\n    act(text: string, opts?: {\n        incident?: string;\n        cut?: number;\n        sev?: GridEvent['sev'];\n        kind?: GridEvent['kind'];\n    }): GridEvent;\n    reset(): void;\n};\nexport declare function createControl(net: Network, opts: ControlOptions): Control;"
        },
        {
          "file": "cpu-oscillators.ts",
          "declarations": "import { type Network, type NodeParams } from './model';\nimport { type Oscillators, type OscOptions } from './oscillators';\nexport declare function createCpuOscillators(canvas: HTMLCanvasElement, net: Network, prm: NodeParams, opts?: OscOptions & {\n    budgetMs?: number;\n    drawHz?: number;\n}): Oscillators;"
        },
        {
          "file": "model.ts",
          "declarations": "export declare const TAU: number;\nexport declare const DT: number;\nexport declare function stepsFor(dt: number, speed?: number, max?: number): number;\nexport declare const NODE: {\n    readonly small: 0;\n    readonly hub: 1;\n    readonly bus: 2;\n    readonly unit: 3;\n};\nexport declare const LINE: {\n    readonly local: 0;\n    readonly feed: 1;\n    readonly ring: 2;\n    readonly tx: 3;\n    readonly trunk: 4;\n};\nexport type Network = {\n    n: number;\n    m: number;\n    width: number;\n    height: number;\n    x: Float32Array;\n    y: Float32Array;\n    kind: Uint8Array;\n    group: Uint8Array;\n    groups: string[];\n    a: Uint32Array;\n    b: Uint32Array;\n    K: Float32Array;\n    cap: Float32Array;\n    gamma: Float32Array;\n    lineKind: Uint8Array;\n    row: Uint32Array;\n    adjNode: Uint32Array;\n    adjEdge: Uint32Array;\n};\nexport type LineSpec = {\n    a: number;\n    b: number;\n    K: number;\n    cap?: number;\n    gamma?: number;\n    kind?: number;\n};\nexport declare function makeNetwork(input: {\n    width: number;\n    height: number;\n    x: ArrayLike<number>;\n    y: ArrayLike<number>;\n    kind?: ArrayLike<number>;\n    group?: ArrayLike<number>;\n    groups?: string[];\n    lines: LineSpec[];\n}): Network;\nexport type Limits = {\n    band: number;\n    ufls: Array<[\n        number,\n        number\n    ]>;\n    trip: number;\n    tripAfter: number;\n    thermal: number;\n    instant: number;\n    slip: number;\n    cool: number;\n};\nexport declare const GRID_LIMITS: Limits;\nexport declare const FREE_LIMITS: Limits;\nexport type NodeParams = {\n    p0: Float32Array;\n    p1: Float32Array;\n    theta0: Float32Array;\n    size: Float32Array;\n    tag: Uint8Array;\n};\nexport declare function emptyParams(n: number): NodeParams;\nexport declare const wrap: (a: number) => number;\nexport declare function inertiaFloor(net: Network, dt?: number, kScale?: number): Float32Array;\nexport declare function nodeUpdate(p0: Float32Array, p1: Float32Array, i: number, th: number, om: number, g: number, shed: number, F: number, Gw: number, Gs: number, dt: number, agc: number, limits: Limits): [\n    number,\n    number,\n    number,\n    number\n];\nexport type SimState = {\n    s: Float32Array;\n    aux: Float32Array;\n    es: Float32Array;\n};\nexport type Reduction = {\n    sc: number;\n    ss: number;\n    mw: number;\n    mSum: number;\n    alive: number;\n    shedMW: number;\n    gov: number;\n};\nexport declare class CpuTwin {\n    readonly net: Network;\n    limits: Limits;\n    kScale: number;\n    kMean: number;\n    time: number;\n    s: Float32Array;\n    aux: Float32Array;\n    es: Float32Array;\n    p0: Float32Array;\n    p1: Float32Array;\n    constructor(net: Network, prm: NodeParams, limits?: Limits);\n    setParams(prm: NodeParams, reset?: boolean): void;\n    cutLine(k: number): void;\n    step(dt: number, agc: number): void;\n    edgePass(fdt: number): void;\n    frame(steps: number, dt: number, agc: number): Reduction;\n    reduce(): Reduction;\n    get state(): SimState;\n}\nexport declare function reduceState(net: Network, p0: Float32Array, s: Float32Array, aux: Float32Array): Reduction;\nexport declare function orderParameter(theta: ArrayLike<number>, stride?: number, alive?: ArrayLike<number>, aliveStride?: number): {\n    r: number;\n    psi: number;\n};\nexport declare function components(net: Network, on?: (k: number) => boolean, alive?: (i: number) => boolean): {\n    id: Int32Array<ArrayBuffer>;\n    count: number;\n    largest: number;\n    size: Map<number, number>;\n};\nexport declare function steady(net: Network, P: ArrayLike<number>, { iters, kScale }?: {\n    iters?: number | undefined;\n    kScale?: number | undefined;\n}): Float32Array;\nexport type Figures = {\n    f: number;\n    df: number;\n    r: number;\n    psi: number;\n    alive: number;\n    dark: number;\n    load: number;\n    darkLoad: number;\n    shed: number;\n    gov: number;\n    over: number;\n    hot: number;\n    off: number;\n    groups: Array<{\n        name: string;\n        phase: number;\n        rel: number;\n        r: number;\n        f: number;\n        alive: number;\n    }>;\n};\nexport declare function readFigures(net: Network, prm: NodeParams, st: SimState, f0: number): Figures;\nexport declare function pcg(v: number): number;\nexport declare function seeded(seed: number): () => number;"
        },
        {
          "file": "networks.ts",
          "declarations": "import { type Network, type NodeParams } from './model';\nexport type Tech = 'nuclear' | 'gas' | 'peaker' | 'hydro' | 'pumped' | 'wind' | 'solar' | 'battery' | 'link';\nexport declare const TECH: Record<Tech, {\n    name: string;\n    H: number;\n    droop: number;\n    Tg: number;\n    agc: boolean;\n}>;\nexport declare const TECHS: Tech[];\nexport type Scenario = 'peak' | 'noon';\nexport declare const SCENARIOS: Record<Scenario, {\n    name: string;\n    says: string;\n}>;\nexport type Plant = {\n    tech: Tech;\n    name: string;\n    x: number;\n    y: number;\n    offshore: boolean;\n    bus: number;\n    units: number[];\n    rating: number[];\n    disp: Record<Scenario, number[]>;\n    head: Record<Scenario, number[]>;\n};\nexport type Town = {\n    name: string;\n    x: number;\n    y: number;\n    pop: number;\n    sigma: number;\n    hubs: number[];\n};\nexport type Island = {\n    seed: number;\n    net: Network;\n    towns: Town[];\n    plants: Plant[];\n    corridors: Array<{\n        line: number;\n        name: string;\n    }>;\n    land(x: number, y: number): number;\n    steadyFor(sc: Scenario): Float32Array;\n    nameOf(i: number): string;\n    load: Float32Array;\n    heaviestCorridor(sc: Scenario): number;\n    study: Record<Scenario, {\n        corridor: number;\n        line: number;\n    }>;\n};\nexport declare function powerIsland({ seed, n }?: {\n    seed?: number | undefined;\n    n?: number | undefined;\n}): Island;\nexport type IslandChanges = {\n    tripped?: Set<number>;\n    scale?: Map<number, number>;\n};\nexport type IslandParams = NodeParams & {\n    plantOf: Map<number, Plant>;\n    info: {\n        inertiaGWs: number;\n        loadMW: number;\n        largestMW: number;\n        agcHead: number;\n    };\n};\nexport declare function islandParams(island: Island, sc: Scenario, changes?: IslandChanges): IslandParams;\nexport declare function landTexture(island: Island, w?: number, h?: number): {\n    data: Uint8Array<ArrayBuffer>;\n    w: number;\n    h: number;\n};\nexport type Swarm = {\n    net: Network;\n    params(spread: number, seed?: number): NodeParams;\n    scatter(prm: NodeParams, seed: number): void;\n};\nexport declare function fireflyMeadow({ seed, cols, rows, width, height }?: {\n    seed?: number | undefined;\n    cols?: number | undefined;\n    rows?: number | undefined;\n    width?: number | undefined;\n    height?: number | undefined;\n}): Swarm;\nexport declare function metronomeBoards({ seed, cols, rows, perBoard, width, height }?: {\n    seed?: number | undefined;\n    cols?: number | undefined;\n    rows?: number | undefined;\n    perBoard?: number | undefined;\n    width?: number | undefined;\n    height?: number | undefined;\n}): Swarm;"
        },
        {
          "file": "oscillators.ts",
          "declarations": "import { type Limits, type Network, type NodeParams, type Reduction } from './model';\nexport type OscLook = {\n    theme: number;\n    style: 0 | 1 | 2;\n    beatHz: number;\n    lag: number;\n    pulse: number;\n    wheelHz: number;\n    ringHz: number;\n    bandHz: number;\n    shedHz: number;\n    lineAlpha: number;\n    calm: boolean;\n    alarm: number;\n    land: boolean;\n};\nexport declare const LOOKS: Record<'grid' | 'fireflies' | 'metronomes', OscLook>;\nexport type OscView = {\n    mode: 'map' | 'wheel';\n    clip: [\n        number,\n        number,\n        number,\n        number\n    ];\n    map?: {\n        ox: number;\n        oy: number;\n        s: number;\n    };\n    wheel?: {\n        cx: number;\n        cy: number;\n        R: number;\n    };\n    highlight?: number;\n    scale?: number;\n    dim?: number;\n};\nexport type SimSettings = {\n    limits: Limits;\n    kScale: number;\n    kMean: number;\n    agc: number;\n};\nexport type Readout = {\n    s: Float32Array;\n    aux: Float32Array;\n    es: Float32Array;\n    reduction: Reduction;\n    time: number;\n};\nexport type Oscillators = {\n    readonly kind: 'webgpu' | 'cpu';\n    readonly time: number;\n    settings: SimSettings;\n    look: OscLook;\n    hover: {\n        node: number;\n        line: number;\n    };\n    upload(prm: NodeParams, strainRef?: Float32Array): void;\n    reset(prm: NodeParams, strainRef?: Float32Array): void;\n    cutLine(k: number): void;\n    resize(width: number, height: number, dpr: number): void;\n    frame(dt: number, views: OscView[], opts?: {\n        speed?: number;\n        read?: boolean;\n    }): boolean;\n    onRead: ((r: Readout) => void) | null;\n    onLost: ((why: string) => void) | null;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport type OscOptions = {\n    land?: {\n        data: Uint8Array<ArrayBuffer>;\n        w: number;\n        h: number;\n    };\n    maxViews?: number;\n};\nexport declare function packLines(net: Network): Float32Array<ArrayBuffer>;\nexport declare function packParams(net: Network, prm: NodeParams, strainRef?: Float32Array): Float32Array<ArrayBuffer>;\nexport declare function packSim(out: ArrayBuffer, n: number, m: number, s: SimSettings, dt: number, time: number, fdt: number): void;\nexport declare function createOscillators(canvas: HTMLCanvasElement, net: Network, prm: NodeParams, opts?: OscOptions): Promise<Oscillators | null>;"
        }
      ],
      "pitfalls": [
        "The step is semi-implicit in the damping, and still needs a floor on inertia",
        "Even steps a frame: the node pass ping-pongs two state buffers, and the line pass",
        "The mean field lags one frame",
        "Start a grid from its steady state (steady(), a Newton solve), never from zero angles",
        "A line rating of Infinity is written as 1e30 for the GPU",
        "Read-back is asynchronous and about ten times a second",
        "The CPU and GPU twins do the same arithmetic but not the same rounding",
        "Grid ratings come from the steady flows of both scenarios and from an N-1 study",
        "Explicit bind group layouts",
        "The CPU twin is about a third of real time for 4,096 nodes on a laptop (about 0.4 ms a step)"
      ],
      "card": "entries/grid-oscillators.json"
    },
    {
      "id": "ground-relief",
      "aliases": [],
      "name": "Ground relief light and slope views",
      "summary": "Make the shape of bright ground readable: lengthen its normal’s tilt for lighting, distinguish lee and windward faces, and bake local horizon occlusion into hollows. World-fixed projection planes in three rings, sixteen ways round, keep tiles close to their real size on steep faces without turning the texture with each pixel’s normal. Includes mask offsets and a pixel-footprint fade for small patterns. The demo compares identical dunes under the same camera and sun, with a checker view to isolate stretching against ordinary triplanar mapping.",
      "category": "technique",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "calm",
      "tags": [
        "terrain",
        "heightfield",
        "dunes",
        "sand",
        "snow",
        "hillshade",
        "relief light",
        "hollow shade",
        "ambient occlusion",
        "slope",
        "projection",
        "triplanar",
        "texture stretching",
        "world space",
        "tsl",
        "three.js",
        "webgpu",
        "webgl"
      ],
      "useCases": [
        "bright sand or snow whose height differences disappear under front lighting",
        "terrain tiles stretched into streaks on banks and cliffs",
        "local sky occlusion for heightfield chunks, updated after edits or neighbour arrival",
        "stable procedural terrain patterns that fade before they shimmer"
      ],
      "interaction": "Drag to turn both views · toggle the four terms · Compare stretching isolates slope views on checker tiles",
      "kits": [],
      "pairsWith": [
        {
          "id": "heightfield-chunks",
          "why": "Supplies chunk meshes and height samples; bake hollows when a chunk or neighbour changes"
        },
        {
          "id": "sun-shadow",
          "why": "Relief makes shape readable; the sun’s shadow still describes actual occluders"
        },
        {
          "id": "material-designer",
          "why": "Project baked tile maps from fixed slope views instead of stretching them down a cliff"
        }
      ],
      "variants": [],
      "version": "1.0.2",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "mixed",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "96 × 96 terrain cells per view",
          "low": "64 × 64 terrain cells per view"
        },
        "reducedMotion": false
      },
      "toneKnobs": [
        {
          "name": "light",
          "in": "module",
          "values": {
            "strict": 0,
            "refined": 0.5,
            "playful": 0.8
          },
          "note": "Exaggerates the normal’s tilt for light, without changing geometry"
        },
        {
          "name": "hollows",
          "in": "module",
          "values": {
            "strict": 0.3,
            "refined": 0.6
          },
          "note": "Controls how strongly local hollows lose sky light"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 0.322,
          "cpuMs": 0.195,
          "cpuP95Ms": 0.32,
          "badge": "light",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.172,
            "p99Ms": 7.15,
            "low1Fps": 126.7
          },
          "notes": "Two views of the same static 32 m heightfield, 128 × 128 cells at high quality. Left: plain triplanar. Right: relief normal, lee tone, baked vertex occlusion and world-fixed slope views. Procedural tiles, no texture fetches, no automatic camera motion. Occlusion bakes once at setup."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "intel xe-2lpg",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Microsoft Edge 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 1.376,
          "cpuMs": 0.79,
          "cpuP95Ms": 1.31,
          "badge": "moderate",
          "drawCalls": 34,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Microsoft Edge 157, Chromium 157 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 390 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 3.514,
          "cpuMs": 0.2,
          "cpuP95Ms": 0.74,
          "badge": "heavy",
          "drawCalls": 34,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 970 ms."
        }
      ],
      "signatures": [
        {
          "file": "ground-relief.ts",
          "declarations": "import type { Node } from 'three/webgpu';\nexport declare const RELIEF: {\n    readonly step: 2;\n    readonly reach: 12;\n    readonly light: 2;\n    readonly hollow: 2.5;\n    readonly deepest: 0.85;\n    readonly sun: 0.3;\n};\nexport declare const LEE: {\n    readonly wind: readonly [\n        0.8,\n        0.6\n    ];\n    readonly gain: 0.6;\n    readonly most: 0.15;\n};\nexport declare const BRIGHT_RELIEF: {\n    readonly light: 1;\n    readonly hollows: 0.67;\n};\nexport declare const DEFAULT_GROUND_RELIEF: {\n    readonly light: 0.5;\n    readonly hollows: 0.6;\n};\nexport type GroundReliefOptions = {\n    light?: number;\n    hollows?: number;\n};\nexport declare function createGroundRelief(options?: GroundReliefOptions): {\n    reliefLight: import(\"three/webgpu\").UniformNode<\"float\", number>;\n    hollowShade: import(\"three/webgpu\").UniformNode<\"float\", number>;\n    set: (light: number, hollows: number) => void;\n};\ntype F = Node<'float'>;\ntype V3 = Node<'vec3'>;\nexport declare const reliefNormal: import(\"three/tsl\").FnNode<[\n    Node<\"vec3\"> | import(\"three\").Vector3,\n    number | Node<\"float\"> | Node<\"uint\">\n], Node<\"vec3\">>;\nexport declare const leeShade: import(\"three/tsl\").FnNode<[\n    Node<\"vec3\"> | import(\"three\").Vector3,\n    number | Node<\"float\"> | Node<\"uint\">,\n    number | Node<\"float\"> | Node<\"uint\">\n], Node<\"float\">>;\nexport declare const hollowFactors: import(\"three/tsl\").FnNode<[\n    number | Node<\"float\"> | Node<\"uint\">,\n    number | Node<\"float\"> | Node<\"uint\">,\n    number | Node<\"float\"> | Node<\"uint\">\n], import(\"three/webgpu\").JoinNode<\"vec2\">>;\nexport declare const VIEWS: {\n    readonly ring: number;\n    readonly ways: 16;\n    readonly blend: number;\n    readonly sharp: 0.03;\n};\nexport declare const groundViews: import(\"three/tsl\").FnNode<[\n    Node<\"vec3\"> | import(\"three\").Vector3\n], import(\"three/webgpu\").JoinNode<\"vec4\">>;\nexport declare function viewFrame(ring: F, way: F): {\n    n: V3;\n    u: V3;\n    v: V3;\n};\nexport declare const MASKS: {\n    readonly from: number;\n    readonly to: number;\n    readonly reach: 0.6;\n    readonly scale: 0.9;\n};\nexport declare const maskShift: import(\"three/tsl\").FnNode<[\n    Node<\"vec3\"> | import(\"three\").Vector3,\n    Node<\"vec3\"> | import(\"three\").Vector3\n], Node<\"vec2\">>;\nexport declare const footprintFade: import(\"three/tsl\").FnNode<[\n    number | Node<\"float\"> | Node<\"uint\">,\n    number | Node<\"float\"> | Node<\"uint\">\n], Node<\"float\">>;\nexport declare function viewPixel(): F;\nexport declare const facingView: (n: V3, least?: number) => Node<\"float\">;\nexport type ReliefRegion = {\n    x0: number;\n    z0: number;\n    x1: number;\n    z1: number;\n};\nexport type ReliefOcclusionOptions = {\n    step?: number;\n    reach?: number;\n    into?: Float32Array;\n    region?: ReliefRegion;\n};\nexport declare function reliefOcclusion(heightAt: (x: number, z: number) => number, west: number, south: number, size: number, options?: ReliefOcclusionOptions): Float32Array<ArrayBufferLike>;\nexport declare function writeOcclusion(out: Uint8Array, base: number, grid: Float32Array, n: number, resolution: number, region?: ReliefRegion): void;\nexport {};"
        }
      ],
      "pitfalls": [
        "Use the geometric normal",
        "Keep projections fixed in the world",
        "A world normal is already transformed",
        "Horizon samples cross chunk edges",
        "Grid and image rows run opposite ways",
        "Take texture derivatives before branches",
        "Projection weights can ghost between views",
        "Relief is a lighting treatment",
        "No measurement yet: hollow work scales with grid points and reach / step"
      ],
      "card": "entries/ground-relief.json"
    },
    {
      "id": "growing-tree",
      "aliases": [],
      "name": "A tree that grows as a front",
      "summary": "A tree grown by rule from a seed (Weber and Penn: a trunk forking into leaders, branches in a golden-angle spiral, bending to the light, drooping, kept in a crown) and drawn growing: every vertex knows how far along the wood it is from the root and how far the furthest tip it carries is, so the vertex shader grows the whole tree from one number. A front runs out along every branch at once, each limb swelling by the share of what it carries that has grown (the pipe model, while growing), each tip ending exactly at the front, leaves and blossom budding as it passes them. Nothing is simulated or stored, so growth scrubs back as exactly as forward and the tree rests when grown. The year is a pure function too: buds, blossom, leaves from the trunk out, autumn colour from the tips in, leaves that let go one by one, drift down and lie on the ground. One mesh for the wood, one instanced draw for the leaves, no compute: it runs on WebGPU and on WebGL 2.",
      "category": "simulation",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "balanced",
      "tags": [
        "trees",
        "growth",
        "weber–penn",
        "procedural",
        "pipe model",
        "phyllotaxis",
        "scrubbable",
        "pure function",
        "vertex shader",
        "tsl",
        "seasons",
        "falling leaves",
        "blossom",
        "instancing",
        "draw on demand",
        "webgl fallback",
        "seeded"
      ],
      "useCases": [
        "a growth moment in a title, a splash or a loading screen, scrubbed by a timeline",
        "a tree that grows with a progress value (a goal reached, a streak kept, a project done)",
        "seasons on one tree, shown at any time of year at once",
        "a seeded tree for a scene: the same seed grows the same tree on every machine",
        "teaching how trees branch, thicken and come into leaf"
      ],
      "interaction": "Watch it grow · drag the growth bar either way · slide the season or Play the year · pick a shape and a seed · drag to orbit",
      "kits": [],
      "pairsWith": [
        {
          "id": "gpu-foliage",
          "why": "Many trees grown on the GPU"
        },
        {
          "id": "meadow-grass",
          "why": "Grass round the trunk"
        },
        {
          "id": "cloud-shadows",
          "why": "Cloud shade drifting over the crown"
        }
      ],
      "variants": [
        {
          "id": "gpu-foliage",
          "note": "Grown in compute on the GPU: broadleaf, spruce and bush, with self-shadowed crowns and forests"
        }
      ],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "mixed",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 1.117,
          "cpuMs": 0.36,
          "cpuP95Ms": 0.94,
          "badge": "moderate",
          "drawCalls": 7,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.733,
            "p99Ms": 6.83,
            "low1Fps": 144
          },
          "notes": "Measured growing the cherry (12,000 leaves) from seed to grown every 6 s with the front glowing, a breeze of 0.5 and a 2048 shadow map: every frame redraws the wood (about 238,000 triangles), the leaves and the shadow pass. Grown and still, it draws nothing."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 4.063,
          "cpuMs": 1.13,
          "cpuP95Ms": 1.545,
          "badge": "heavy",
          "drawCalls": 7,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 1212 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 4.686,
          "cpuMs": 0.63,
          "cpuP95Ms": 0.88,
          "badge": "heavy",
          "drawCalls": 7,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 1256 ms."
        }
      ],
      "signatures": [
        {
          "file": "growing-tree.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { TreeLook } from './species';\nimport { type GrownTree } from './tree';\nexport type GrowingTreeOptions = {\n    glow?: number;\n    glowColour?: THREE.ColorRepresentation;\n    leafRows?: number;\n};\nexport type GrowingTree = {\n    readonly object: THREE.Group;\n    readonly wood: THREE.Mesh;\n    readonly leaves: THREE.Mesh;\n    readonly tree: GrownTree;\n    setGrowth(progress: number): void;\n    setSeason(season: number): void;\n    setWind(strength: number, direction?: [\n        number,\n        number\n    ]): void;\n    setTime(seconds: number): void;\n    setGlow(strength: number): void;\n    setTree(tree: GrownTree, look: TreeLook): void;\n    dispose(): void;\n};\nexport declare function leafGeometry(rows?: number): THREE.BufferGeometry;\nexport declare function createGrowingTree(tree: GrownTree, look: TreeLook, options?: GrowingTreeOptions): GrowingTree;"
        },
        {
          "file": "growth.ts",
          "declarations": "import type { GrownTree } from './tree';\nexport declare const TIP = 0.35;\nexport declare const BUD = 0.16;\nexport declare const smoothstep: (a: number, b: number, x: number) => number;\nexport declare function growthAt(tree: Pick<GrownTree, 'smax'>, progress: number): {\n    front: number;\n    scale: number;\n};\nexport declare function radiusShare(front: number, s: number, smax: number): number;\nexport declare const leafGrown: (front: number, s: number) => number;\nexport type LeafSeason = {\n    size: number;\n    bloom: number;\n    turn: number;\n    fall: number;\n};\nexport declare function leafSeason(season: number, order: number, seed: number, blossom: boolean): LeafSeason;\nexport declare function fallenAt(at: [\n    number,\n    number,\n    number\n], fall: number, seed: number, wind?: [\n    number,\n    number\n]): [\n    number,\n    number,\n    number\n];\nexport declare function seasonName(season: number): 'Winter' | 'Spring' | 'Summer' | 'Autumn';\nexport declare function growthProfile(tree: GrownTree, bins?: number): {\n    wood: Float32Array;\n    leaves: Float32Array;\n};\nexport type Bounds = {\n    centre: [\n        number,\n        number,\n        number\n    ];\n    radius: number;\n    up: number;\n    across: number;\n};\nexport declare function grownBounds(tree: Pick<GrownTree, 'smax' | 'skeleton'>, bins?: number): (progress: number) => Bounds;\nexport type GrowthClock = {\n    readonly progress: number;\n    readonly playing: boolean;\n    readonly resting: boolean;\n    tick(dt: number): boolean;\n    play(): void;\n    pause(): void;\n    scrub(progress: number): void;\n    duration: number;\n};\nexport declare function createGrowthClock(options?: {\n    duration?: number;\n    progress?: number;\n}): GrowthClock;"
        },
        {
          "file": "species.ts",
          "declarations": "import type { TreeSpec } from './tree';\nexport type Rgb = [\n    number,\n    number,\n    number\n];\nexport type TreeLook = {\n    bark: Rgb;\n    fresh: Rgb;\n    leaf: Rgb;\n    autumn: [\n        Rgb,\n        Rgb\n    ];\n    blossom: Rgb | null;\n    leafLength: number;\n    leafWidth: number;\n};\nexport type Species = {\n    name: string;\n    spec: TreeSpec;\n    look: TreeLook;\n};\nexport declare const SPECIES: {\n    cherry: {\n        name: string;\n        spec: {\n            seed: number;\n            trunk: number;\n            base: number;\n            lean: number;\n            leaders: number;\n            reach: number;\n            spread: number;\n            leaderUp: number;\n            leaderDroop: number;\n            levels: {\n                every: number;\n                from: number;\n                length: number;\n                angle: number;\n                up: number;\n                droop: number;\n                gnarl: number;\n                step: number;\n                sides: number;\n            }[];\n            crown: {\n                width: number;\n                mid: number;\n                top: number;\n            };\n            tip: number;\n            pipe: number;\n            spurs: {\n                level: number;\n                every: number;\n                per: [\n                    number,\n                    number\n                ];\n                stalk: number;\n                droop: number;\n            };\n            trunkSides: number;\n            trunkStep: number;\n        };\n        look: {\n            bark: [\n                number,\n                number,\n                number\n            ];\n            fresh: [\n                number,\n                number,\n                number\n            ];\n            leaf: [\n                number,\n                number,\n                number\n            ];\n            autumn: [\n                [\n                    number,\n                    number,\n                    number\n                ],\n                [\n                    number,\n                    number,\n                    number\n                ]\n            ];\n            blossom: [\n                number,\n                number,\n                number\n            ];\n            leafLength: number;\n            leafWidth: number;\n        };\n    };\n    maple: {\n        name: string;\n        spec: {\n            seed: number;\n            trunk: number;\n            base: number;\n            lean: number;\n            leaders: number;\n            reach: number;\n            spread: number;\n            leaderUp: number;\n            leaderDroop: number;\n            levels: {\n                every: number;\n                from: number;\n                length: number;\n                angle: number;\n                up: number;\n                droop: number;\n                gnarl: number;\n                step: number;\n                sides: number;\n            }[];\n            crown: {\n                width: number;\n                mid: number;\n                top: number;\n            };\n            tip: number;\n            pipe: number;\n            spurs: {\n                level: number;\n                every: number;\n                per: [\n                    number,\n                    number\n                ];\n                stalk: number;\n                droop: number;\n            };\n            trunkSides: number;\n            trunkStep: number;\n        };\n        look: {\n            bark: [\n                number,\n                number,\n                number\n            ];\n            fresh: [\n                number,\n                number,\n                number\n            ];\n            leaf: [\n                number,\n                number,\n                number\n            ];\n            autumn: [\n                [\n                    number,\n                    number,\n                    number\n                ],\n                [\n                    number,\n                    number,\n                    number\n                ]\n            ];\n            blossom: null;\n            leafLength: number;\n            leafWidth: number;\n        };\n    };\n    oak: {\n        name: string;\n        spec: {\n            seed: number;\n            trunk: number;\n            base: number;\n            lean: number;\n            leaders: number;\n            reach: number;\n            spread: number;\n            leaderUp: number;\n            leaderDroop: number;\n            levels: {\n                every: number;\n                from: number;\n                length: number;\n                angle: number;\n                up: number;\n                droop: number;\n                gnarl: number;\n                step: number;\n                sides: number;\n            }[];\n            crown: {\n                width: number;\n                mid: number;\n                top: number;\n            };\n            tip: number;\n            pipe: number;\n            spurs: {\n                level: number;\n                every: number;\n                per: [\n                    number,\n                    number\n                ];\n                stalk: number;\n                droop: number;\n            };\n            trunkSides: number;\n            trunkStep: number;\n        };\n        look: {\n            bark: [\n                number,\n                number,\n                number\n            ];\n            fresh: [\n                number,\n                number,\n                number\n            ];\n            leaf: [\n                number,\n                number,\n                number\n            ];\n            autumn: [\n                [\n                    number,\n                    number,\n                    number\n                ],\n                [\n                    number,\n                    number,\n                    number\n                ]\n            ];\n            blossom: null;\n            leafLength: number;\n            leafWidth: number;\n        };\n    };\n    birch: {\n        name: string;\n        spec: {\n            seed: number;\n            trunk: number;\n            base: number;\n            lean: number;\n            leaders: number;\n            reach: number;\n            spread: number;\n            leaderUp: number;\n            leaderDroop: number;\n            levels: {\n                every: number;\n                from: number;\n                length: number;\n                angle: number;\n                up: number;\n                droop: number;\n                gnarl: number;\n                step: number;\n                sides: number;\n            }[];\n            crown: {\n                width: number;\n                mid: number;\n                top: number;\n            };\n            tip: number;\n            pipe: number;\n            spurs: {\n                level: number;\n                every: number;\n                per: [\n                    number,\n                    number\n                ];\n                stalk: number;\n                droop: number;\n            };\n            trunkSides: number;\n            trunkStep: number;\n        };\n        look: {\n            bark: [\n                number,\n                number,\n                number\n            ];\n            fresh: [\n                number,\n                number,\n                number\n            ];\n            leaf: [\n                number,\n                number,\n                number\n            ];\n            autumn: [\n                [\n                    number,\n                    number,\n                    number\n                ],\n                [\n                    number,\n                    number,\n                    number\n                ]\n            ];\n            blossom: null;\n            leafLength: number;\n            leafWidth: number;\n        };\n    };\n};\nexport type SpeciesId = keyof typeof SPECIES;"
        },
        {
          "file": "tree.ts",
          "declarations": "import { type Vec3 } from './vec';\nexport type Level = {\n    every: number;\n    from: number;\n    length: number;\n    angle: number;\n    up: number;\n    droop: number;\n    gnarl: number;\n    step: number;\n    sides: number;\n};\nexport type TreeSpec = {\n    seed: number;\n    trunk: number;\n    base: number;\n    lean: number;\n    leaders: number;\n    reach: number;\n    spread: number;\n    leaderUp: number;\n    leaderDroop: number;\n    levels: Level[];\n    crown: {\n        width: number;\n        mid: number;\n        top: number;\n    };\n    tip: number;\n    pipe: number;\n    spurs: {\n        level: number;\n        every: number;\n        per: [\n            number,\n            number\n        ];\n        stalk: number;\n        droop: number;\n    };\n    trunkSides: number;\n    trunkStep: number;\n};\nexport declare const LEAF_FLOATS = 12;\nexport type GrownTree = {\n    centre: Float32Array;\n    ring: Float32Array;\n    back: Float32Array;\n    info: Float32Array;\n    normal: Float32Array;\n    indices: Uint32Array;\n    vertexCount: number;\n    leaves: Float32Array;\n    leafCount: number;\n    branchCount: number;\n    smax: number;\n    skeleton: {\n        pts: number[];\n        s: number[];\n        level: number;\n    }[];\n    box: {\n        min: Vec3;\n        max: Vec3;\n    };\n};\nexport declare function growTree(spec: TreeSpec, leafBudget: number): GrownTree;"
        }
      ],
      "pitfalls": [
        "A front that only shrinks rings to nothing advances a ring at a time",
        "Thicken by the share of what a point carries that has grown (ahead ÷ (smax − s))",
        "Never let the growth or the year depend on the last frame",
        "The CPU rules in growth.ts and the shader in growing-tree.ts are the same formulas written twice",
        "Check the tubes’ winding against their ring order",
        "Swap a new tree into the same meshes and materials (`setTree`)",
        "The vertex shader places everything, so the meshes are never frustum culled",
        "Draw on demand: with no breeze nothing moves once the tree has grown",
        "Growing a tree is CPU work at load or on a change of seed",
        "three r187 has dropped PCFSoftShadowMap"
      ],
      "card": "entries/growing-tree.json"
    },
    {
      "id": "guided-tour",
      "aliases": [],
      "name": "Guided tour: spotlight and coach marks",
      "summary": "Onboarding steps attached to parts of the page. A spotlight dims everything else and cuts the target out with rounded corners, gliding from step to step; a popover with an arrow sits on the side with the most room, flips and slides to stay in view, and becomes a sheet on a phone. It scrolls each target into view, follows it as it moves, waits for targets that appear later (and skips them with a note if they never do), lets people use the target when a step asks them to, and hands \"don’t show again\" to the app to store.",
      "category": "ui",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "onboarding",
        "guided tour",
        "coach marks",
        "spotlight",
        "walkthrough",
        "popover",
        "non-modal dialog",
        "placement",
        "flip",
        "bottom sheet",
        "MutationObserver",
        "ResizeObserver",
        "accessibility",
        "keyboard",
        "touch",
        "rtl",
        "dom",
        "css",
        "no dependencies"
      ],
      "useCases": [
        "a first-run tour of a new app",
        "showing what changed after a release",
        "teaching a feature by having people use it (\"now click Save\")",
        "help that points at the control it is about",
        "empty states that lead into the first action"
      ],
      "interaction": "Follow the tour with the buttons or the arrow keys · click New note when asked · Esc ends it · ? starts it again",
      "kits": [
        {
          "kit": "foundations",
          "as": "optional"
        },
        {
          "kit": "shop",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "accessible-dialog",
          "why": "The same focus and inert rules for its steps"
        },
        {
          "id": "beside-placement",
          "why": "Its popovers sit beside the target, never over it"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the tour driving itself: one step every 40 frames through all eight, gliding the spotlight and popover between targets (one read and one write a frame while it glides), scrolling the list to the last targets, waiting for a note that appears 600 ms after it is asked for, then ending and starting again. Between steps nothing runs: no timers, no animation frames."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 30 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.02,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 37 ms."
        }
      ],
      "signatures": [
        {
          "file": "guided-tour.ts",
          "declarations": "import { type LogicalSide } from './placement';\nexport type { Rect } from './geometry';\nexport type { LogicalSide as TourSide } from './placement';\nexport type TourTarget = Element | string | (() => Element | null | undefined);\nexport type TourOutside = 'block' | 'pass' | 'end';\nexport type TourEndReason = 'done' | 'skip' | 'escape' | 'outside' | 'api';\nexport type TourNavigation = 'next' | 'back' | 'key' | 'action' | 'api';\nexport type TourStep = {\n    id?: string;\n    target?: TourTarget;\n    title: string;\n    text?: string;\n    content?: Node;\n    side?: LogicalSide;\n    padding?: number;\n    radius?: number;\n    interactive?: boolean;\n    advanceOn?: string;\n    outside?: TourOutside;\n    waitFor?: number;\n    before?: () => void | Promise<unknown>;\n};\nexport type TourLabels = {\n    next: string;\n    back: string;\n    skip: string;\n    done: string;\n    progress: (step: number, count: number) => string;\n    dontShowAgain: string;\n    skipped: (count: number) => string;\n};\nexport type TourEnd = {\n    reason: TourEndReason;\n    index: number;\n    dontShowAgain: boolean;\n};\nexport type TourParts = {\n    popover: HTMLElement;\n    body: HTMLElement;\n    progress: HTMLElement;\n    title: HTMLElement;\n    text: HTMLElement;\n    content: HTMLElement;\n    footer: HTMLElement;\n    skip: HTMLButtonElement;\n    back: HTMLButtonElement;\n    next: HTMLButtonElement;\n};\nexport type TourStepState = {\n    index: number;\n    count: number;\n    first: boolean;\n    last: boolean;\n};\nexport type TourPhase = 'open' | 'step' | 'close';\nexport type TourOptions = {\n    steps: TourStep[];\n    host?: HTMLElement;\n    root?: Document | ShadowRoot | Element;\n    side?: LogicalSide;\n    padding?: number;\n    radius?: number;\n    gap?: number;\n    margin?: number;\n    outside?: TourOutside;\n    waitFor?: number;\n    sheetBelow?: number;\n    scrollIntoView?: boolean | ((target: Element, behavior: ScrollBehavior) => void);\n    dontShowAgain?: boolean;\n    reducedMotion?: boolean;\n    duration?: number;\n    labels?: Partial<TourLabels>;\n    className?: string;\n    renderStep?: (parts: TourParts, step: TourStep, state: TourStepState) => void;\n    animate?: (el: HTMLElement, phase: TourPhase, detail: {\n        reducedMotion: boolean;\n    }) => Promise<unknown> | void;\n    onStep?: (index: number, step: TourStep) => void;\n    onEnd?: (end: TourEnd) => void;\n    onMissing?: (index: number, step: TourStep) => void;\n    onDontShowAgain?: (checked: boolean) => void;\n    onNavigate?: (to: number, from: number, by: TourNavigation) => boolean | void;\n};\nexport type Tour = {\n    start(index?: number): void;\n    next(): void;\n    back(): void;\n    go(index: number): void;\n    end(reason?: TourEndReason): void;\n    refresh(): void;\n    setSteps(steps: TourStep[]): void;\n    readonly active: boolean;\n    readonly index: number;\n    readonly steps: readonly TourStep[];\n    readonly popover: HTMLElement | null;\n    destroy(): void;\n};\nexport declare function createTour(options: TourOptions): Tour;"
        }
      ],
      "pitfalls": [
        "The tour follows its target through scrolling, resizes of the target, its parent and the page",
        "Selectors are looked up when the step shows, not when the tour is made",
        "advanceOn moves the tour on after the event has finished, on a timeout of 0",
        "A host other than document.body must be positioned and should not scroll itself",
        "The dimmed page is not inert",
        "\"Don’t show again\" is only a box",
        "Import guided-tour.base.css before guided-tour.css",
        "Nothing runs between changes, so a target moved by a CSS transform or animation is caught up…"
      ],
      "card": "entries/guided-tour.json"
    },
    {
      "id": "heat-haze-shockwaves",
      "aliases": [],
      "name": "Heat haze & shockwave rings",
      "summary": "Air that bends what is behind it, in three.js on WebGPU (TSL). HeatHaze is the shimmer over fires, exhausts and blasts: camera-facing sprites that push the frame drawn so far with moving noise, strongest in the middle, rising and fading. SonicWaves are shock fronts: a ring opening round an axis (the wake a shot leaves), a shell round a blast, a bright core in flight, each band pushing the picture out with the bright and dark lip of a real shockwave; SonicFx puts them together as a muzzle boom, a shot with its wake, a blast where it lands, a charge-up and a halo. Each is one instanced draw over a ring of slots: the CPU writes a slot when something happens (where, when, how big) and the GPU animates it from its birth time alone, so nothing runs per frame but a clock, and each mesh hides while nothing is alive (a visible one copies the frame once a frame). The demo (a brazier, pillars, and shots fired at a wall where you click) costs about 0.2 ms of GPU and 0.2 ms of CPU a frame at 1080p on a laptop RTX 4060. Reduced motion holds a still bend that fades. Use it for heat over fires and exhausts, explosions, sonic or energy weapons, portals and lenses; it reads best over detail (edges, lit panels, text), less over a flat sky.",
      "category": "post",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "expressive",
      "tags": [
        "distortion",
        "refraction",
        "screen-space",
        "instancing",
        "billboards",
        "tsl",
        "explosions"
      ],
      "useCases": [
        "heat over fires and exhausts",
        "explosions",
        "sonic or energy weapons",
        "shockwaves",
        "portals and lenses"
      ],
      "interaction": "Click anywhere to fire a sonic shot there · drag to orbit",
      "kits": [],
      "pairsWith": [
        {
          "id": "fluid-fire",
          "why": "Haze over real flames"
        },
        {
          "id": "ring-effects",
          "why": "Smoke and marks from the same blast"
        },
        {
          "id": "post-stack",
          "why": "Bloom on the flying core"
        }
      ],
      "variants": [],
      "version": "1.1.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 0.164,
          "cpuMs": 0.22,
          "cpuP95Ms": 0.34,
          "badge": "light",
          "drawCalls": 8,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.152,
            "p99Ms": 6.14,
            "low1Fps": 146.7
          },
          "notes": null
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.721,
          "cpuMs": 0.595,
          "cpuP95Ms": 0.86,
          "badge": "moderate",
          "drawCalls": 8,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 143 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 3.026,
          "cpuMs": 0.32,
          "cpuP95Ms": 0.7,
          "badge": "heavy",
          "drawCalls": 8,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 950 ms."
        }
      ],
      "signatures": [
        {
          "file": "compile-turn.ts",
          "declarations": "export declare function inTurn<T>(renderer: object, job: () => Promise<T>): Promise<T>;"
        },
        {
          "file": "heat-haze.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nexport type HazeLook = {\n    radius: number;\n    strength: number;\n    duration: number;\n    rise: number;\n};\nexport declare const DEFAULT_HAZE: HazeLook;\nexport declare class HeatHaze {\n    readonly object3D: THREE.Mesh;\n    enabled: boolean;\n    constructor(capacity?: number, options?: {\n        reducedMotion?: boolean;\n    });\n    add(haze: HazeLook, at: readonly [\n        number,\n        number,\n        number\n    ], scale?: number): void;\n    setReducedMotion(on: boolean): void;\n    get live(): boolean;\n    update(dt: number): void;\n    clear(): void;\n    dispose(): void;\n}"
        },
        {
          "file": "sonic-fx.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { SonicWaves } from './sonic-waves';\nexport type SonicLook = {\n    tint: string;\n    tintGlow: number;\n    ringEvery: number;\n    ringRadius: number;\n    ringLife: number;\n    bend: number;\n    core: number;\n    boom: number;\n};\nexport declare const DEFAULT_SONIC: SonicLook;\nexport declare function ringStations(length: number, every: number, start?: number): number[];\nexport declare class SonicFx {\n    readonly waves: SonicWaves;\n    constructor(options?: {\n        reducedMotion?: boolean;\n    });\n    setReducedMotion(on: boolean): void;\n    boom(tip: THREE.Vector3Like, along: THREE.Vector3Like, look: SonicLook): void;\n    shot(from: THREE.Vector3, to: THREE.Vector3, look: SonicLook, speed: number, first?: boolean): number;\n    blast(at: THREE.Vector3Like, normal: THREE.Vector3Like, along: THREE.Vector3Like, look: SonicLook, radius: number, strength?: number): void;\n    charging(tip: THREE.Vector3Like, look: SonicLook, level: number, over: number): void;\n    halo(at: THREE.Vector3Like, tall: number, look: SonicLook): void;\n    update(dt: number): void;\n    dispose(): void;\n}"
        }
      ],
      "pitfalls": [
        "Both read the frame drawn so far",
        "three r187: three’s shared frame copy",
        "A hidden mesh is skipped by compileAsync",
        "Draw them after the opaque scene (renderOrder 20/21, transparent, no depth write)",
        "Smoke and other transparent effects drawn before them get bent too",
        "A ring is one-sided: its quad is turned to face the camera along its axis",
        "Slot rings wrap around (a fixed capacity)"
      ],
      "card": "entries/heat-haze-shockwaves.json"
    },
    {
      "id": "heightfield-chunks",
      "aliases": [],
      "name": "Heightfield chunks",
      "summary": "Ground in square chunks that stream round the viewer, from a game’s own world: each chunk’s heightfield includes its border, so neighbours share those samples and meet without cracks or stitching; rings of detail (a 1 m mesh near, 2 m and 4 m farther out) let go farther out than they take, so nothing flickers on the line; a skirt on every mesh hides the gaps where a fine chunk meets a coarse one; normals and hollow shade read across borders, so seams never shade apart. Chunks are made from a height formula and built nearest first, one small job at a time, inside one allowance a frame shared with the rest of the app, and pooled meshes share one material, so nothing compiles as they come and go. A sculpt brush raises, lowers, smooths and flattens on one world lattice, writing every border sample to every chunk that holds it, and hands back each stroke as one undo step.",
      "category": "technique",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "calm",
      "tags": [
        "terrain",
        "heightfield",
        "chunks",
        "streaming",
        "level of detail",
        "LOD rings",
        "hysteresis",
        "skirts",
        "cracks",
        "seams",
        "shared borders",
        "frame budget",
        "time slicing",
        "nearest first",
        "mesh pool",
        "sculpt",
        "terrain brush",
        "editor",
        "undo",
        "ambient occlusion",
        "procedural",
        "value noise",
        "open world",
        "flight",
        "three.js",
        "WebGPU",
        "TSL",
        "no dependencies"
      ],
      "useCases": [
        "an open world or a big level whose ground streams round the player",
        "a terrain editor that sculpts across chunk borders, with undo",
        "a flight or drone view over endless procedural country",
        "a map or site model whose ground comes in tiles",
        "streaming any grid of tiles in a frame allowance, nearest first",
        "hiding seams between tiles of different detail",
        "baking a height formula into tiles that agree at their edges"
      ],
      "interaction": "Drag the ground to sculpt · right-drag to look · Space flies or pauses · L shows the levels",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "meadow-grass",
          "why": "Grass on the streamed ground"
        },
        {
          "id": "desire-paths",
          "why": "Trails worked out over the same heights"
        },
        {
          "id": "cloud-shadows",
          "why": "Cloud shade drifting over it"
        }
      ],
      "variants": [],
      "version": "1.0.2",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "mixed",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 0.966,
          "cpuMs": 0.505,
          "cpuP95Ms": 0.765,
          "badge": "moderate",
          "drawCalls": 65,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 4.11,
            "p99Ms": 7.065,
            "low1Fps": 124.2
          },
          "notes": "Measured flying by itself at 14 m/s over the endless landscape, 38 m up, with the default rings (1 m within 96 m, 2 m within 224 m, 4 m within 480 m: about 210 chunks shown, about 60 drawn after culling). New chunks are made from the height formula and built, nearest first, inside a 2 ms allowance; most frames build none and a few build one or two. The levels view is off."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "intel xe-2lpg",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Microsoft Edge 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 5.636,
          "cpuMs": 2.058,
          "cpuP95Ms": 4.94,
          "badge": "heavy",
          "drawCalls": 71,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Microsoft Edge 157, Chromium 157 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 839 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 3.063,
          "cpuMs": 0.52,
          "cpuP95Ms": 2.26,
          "badge": "heavy",
          "drawCalls": 70,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 925 ms."
        }
      ],
      "signatures": [
        {
          "file": "chunk-terrain.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { type Allowance } from './frame-allowance';\nimport type { Chunk, HeightWorld } from './height-world';\nimport { type Ring } from './rings';\nexport type TerrainOptions = {\n    material: THREE.Material;\n    rings?: readonly Ring[];\n    shade?: boolean;\n    replanAfter?: number;\n    makeRows?: number;\n    onBuilt?(chunk: Chunk, level: number, mesh: THREE.Mesh): void;\n    onReleased?(key: string, level: number, mesh: THREE.Mesh): void;\n    forget?: boolean;\n};\nexport type TerrainStats = {\n    built: number;\n    made: number;\n    released: number;\n    spentMs: number;\n    queued: number;\n    shown: number[];\n    total: number;\n};\nexport declare class ChunkTerrain {\n    readonly object3D: THREE.Group<THREE.Object3DEventMap>;\n    readonly stats: TerrainStats;\n    constructor(world: HeightWorld, options: TerrainOptions);\n    warm(focus: {\n        x: number;\n        z: number;\n    }): void;\n    update(focus: {\n        x: number;\n        z: number;\n    }, budget?: Allowance | number): void;\n    setRings(rings: readonly Ring[]): void;\n    setSkirts(on: boolean): void;\n    releaseAll(): void;\n    levelOf(key: string): number | undefined;\n    shown(): Generator<{\n        key: string;\n        level: number;\n        mesh: THREE.Mesh;\n    }>;\n    compile(renderer: THREE.WebGPURenderer, camera: THREE.Camera, scene: THREE.Scene): Promise<void>;\n    dispose(): void;\n}"
        },
        {
          "file": "frame-allowance.ts",
          "declarations": "export type Allowance = {\n    open(): boolean;\n    spent(): number;\n    readonly ms: number;\n};\nexport declare function allowance(frameMs: number, reservedMs: number, min?: number, max?: number, now?: () => number): Allowance;\nexport declare const allowanceOf: (ms: number, now?: () => number) => Allowance;"
        },
        {
          "file": "grid.ts",
          "declarations": "export type ChunkGrid = {\n    readonly size: number;\n    readonly res: number;\n    readonly cells: number;\n    readonly spacing: number;\n};\nexport declare function chunkGrid(size?: number, res?: number): ChunkGrid;\nexport declare const chunkKey: (x: number, y: number) => string;\nexport declare const keyCoords: (key: string) => [\n    number,\n    number\n];\nexport declare function chunkAt(grid: ChunkGrid, x: number, z: number): {\n    x: number;\n    y: number;\n};\nexport declare function chunksHolding(grid: ChunkGrid, x: number, z: number, eps?: number): Array<[\n    number,\n    number\n]>;\nexport declare const latticeStart: (grid: ChunkGrid, c: number) => number;\nexport declare function chunksHoldingSample(grid: ChunkGrid, i: number, j: number): Array<[\n    number,\n    number\n]>;\nexport declare function sampleIndex(grid: ChunkGrid, cx: number, cy: number, i: number, j: number): number;\nexport declare function sampleField(grid: ChunkGrid, heights: ArrayLike<number>, cx: number, cy: number, x: number, z: number): number;"
        },
        {
          "file": "ground-material.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { ChunkGrid } from './grid';\nexport type GroundColours = {\n    valley: string;\n    meadow: string;\n    rock: string;\n    crest: string;\n    shore?: string;\n};\nexport declare const LEVEL_TINTS: string[];\nexport type GroundMaterialOptions = {\n    colours?: GroundColours;\n    bands?: {\n        low: number;\n        high: number;\n        shore?: number;\n    };\n};\nexport declare function createGroundMaterial(grid: ChunkGrid, options?: GroundMaterialOptions): {\n    material: THREE.MeshStandardNodeMaterial;\n    uniforms: {\n        valley: THREE.UniformNode<\"color\", THREE.Color>;\n        meadow: THREE.UniformNode<\"color\", THREE.Color>;\n        rock: THREE.UniformNode<\"color\", THREE.Color>;\n        crest: THREE.UniformNode<\"color\", THREE.Color>;\n        shore: THREE.UniformNode<\"color\", THREE.Color>;\n        shoreLevel: THREE.UniformNode<\"float\", number>;\n        low: THREE.UniformNode<\"float\", number>;\n        high: THREE.UniformNode<\"float\", number>;\n        levels: THREE.UniformNode<\"float\", number>;\n        focus: THREE.UniformNode<\"vec2\", THREE.Vector2>;\n        rings: THREE.UniformNode<\"vec4\", THREE.Vector4>;\n        tints: THREE.UniformNode<\"color\", THREE.Color>[];\n    };\n    setColours(next: GroundColours): void;\n    dispose(): void;\n};"
        },
        {
          "file": "height-world.ts",
          "declarations": "import { type ChunkGrid } from './grid';\nexport type HeightSource = (x: number, z: number) => number;\nexport type Chunk = {\n    readonly x: number;\n    readonly y: number;\n    readonly key: string;\n    heights: Float32Array;\n    revision: number;\n};\nexport type HeightChange = {\n    keys: readonly string[];\n    area?: {\n        x0: number;\n        z0: number;\n        x1: number;\n        z1: number;\n    };\n};\nexport type HeightWorldOptions = {\n    source?: HeightSource;\n    bounds?: {\n        x0: number;\n        x1: number;\n        y0: number;\n        y1: number;\n    };\n};\nexport declare class HeightWorld {\n    readonly grid: ChunkGrid;\n    readonly chunks: Map<string, Chunk>;\n    constructor(grid: ChunkGrid, options?: HeightWorldOptions);\n    get(key: string): Chunk | undefined;\n    has(key: string): boolean;\n    hasGround(key: string): boolean;\n    bake(cx: number, cy: number): Float32Array;\n    makeRows(key: string, rows: number): Chunk | null;\n    forget(key: string): boolean;\n    add(x: number, y: number, heights: Float32Array, revision?: number): Chunk;\n    ensure(key: string): Chunk | null;\n    heightAt: (x: number, z: number) => number;\n    setHeights(changes: ReadonlyMap<string, Float32Array>, area?: HeightChange['area']): void;\n    reset(): void;\n    onChange(listener: (change: HeightChange) => void): () => void;\n}"
        },
        {
          "file": "sculpt.ts",
          "declarations": "import type { HeightChange, HeightWorld } from './height-world';\nexport type BrushMode = 'raise' | 'lower' | 'smooth' | 'flatten';\nexport type BrushSettings = {\n    mode: BrushMode;\n    radius: number;\n    strength: number;\n};\nexport type Stroke = {\n    mode: BrushMode;\n    before: Map<string, Float32Array>;\n    after: Map<string, Float32Array>;\n    area: NonNullable<HeightChange['area']>;\n};\nexport declare class SculptBrush {\n    constructor(world: HeightWorld);\n    get active(): boolean;\n    begin(x: number, z: number, mode: BrushMode): void;\n    dab(x: number, z: number, dt: number, settings: BrushSettings, pressure?: number): string[];\n    end(): Stroke | null;\n    cancel(): void;\n}\nexport declare function applyStroke(world: HeightWorld, stroke: Stroke, back: boolean): void;\nexport declare function rayGround(origin: {\n    x: number;\n    y: number;\n    z: number;\n}, dir: {\n    x: number;\n    y: number;\n    z: number;\n}, heightAt: (x: number, z: number) => number, max?: number, step?: number): {\n    x: number;\n    y: number;\n    z: number;\n    t: number;\n} | null;"
        }
      ],
      "pitfalls": [
        "Store every border sample in both chunks",
        "Sample a height formula on the world lattice, at whole-number sample indices times the spacing",
        "The resolution must be an odd number of samples (an even number of cells)",
        "Read normals and shade from the world’s heights, past the chunk’s own edge",
        "After an edit, reshape the neighbours whose normals and shade read the changed area",
        "Reshape every chunk a stroke reaches in the same frame",
        "Skirts hide the cracks where a fine chunk meets a coarse one",
        "Give every ring a let-go distance past its take distance (32–64 m)",
        "Plan the rings again only after the viewer has moved some metres (8 here) or something changed",
        "Keep each job small: a unit starts only while the allowance is open",
        "One material and one mesh pool per resolution",
        "Where no chunk is made yet the world reads the formula",
        "Let go of what was made from the formula",
        "Pointer picking marches the heights, not a physics ray"
      ],
      "card": "entries/heightfield-chunks.json"
    },
    {
      "id": "hold-to-confirm",
      "aliases": [],
      "name": "Hold to confirm, four ways",
      "summary": "A safe button for actions that cost something: it acts only after being held. One core (pointer, touch and keys, a grace so a tap never starts it, eased progress that drains when let go, slide-off and Esc to cancel, haptics, screen-reader announcements) and four looks on it: race-car shift lights, a barbell that bends as it lifts, a light-grid upload drawn by one CSS number, and a dialog round which a tunnel of light opens and speeds up while the hold fills. Restyle any of them through their parts.",
      "category": "ui",
      "role": "interaction",
      "stack": [
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "hold to confirm",
        "destructive actions",
        "accessibility",
        "keyboard",
        "touch",
        "haptics",
        "@property",
        "dialog",
        "modal",
        "WAAPI",
        "svg",
        "dom",
        "css",
        "no dependencies"
      ],
      "useCases": [
        "delete, wipe and reset",
        "launch, publish and deploy",
        "purchases and in-game spending",
        "admin and fleet tools",
        "kiosks and touch screens"
      ],
      "interaction": "Press and hold a button (mouse, touch, or Space/Enter) · let go, slide off or Esc to cancel · a quick tap shows the hint",
      "kits": [
        {
          "kit": "shop",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "accessible-dialog",
          "why": "A confirm that needs a hold"
        },
        {
          "id": "labelled-undo",
          "why": "Undo for the actions that can be taken back"
        },
        {
          "id": "ui-sounds",
          "why": "A rising tone while it is held"
        }
      ],
      "variants": [],
      "version": "1.0.3",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 0.135,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.26,
            "p99Ms": 17.965,
            "low1Fps": 52.6
          },
          "notes": "Measured with the three cards holding themselves in turn from code (two holds in three confirm, one is let go at 55%): the cost is the core stepping three holds and the skins redrawing (the shift lights, the bent bar’s SVG, one CSS number for the grid)."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "intel xe-2lpg",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Microsoft Edge 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": null,
          "cpuMs": 0.01,
          "cpuP95Ms": 0.315,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Microsoft Edge 157, Chromium 157 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 2 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": null,
          "cpuMs": 0.02,
          "cpuP95Ms": 0.14,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 121 ms."
        }
      ],
      "signatures": [
        {
          "file": "hold.ts",
          "declarations": "export type HoldState = 'idle' | 'grace' | 'holding' | 'draining' | 'done';\nexport type HoldSource = 'pointer' | 'key' | 'code';\nexport type Ease = (t: number) => number;\nexport declare const easings: {\n    linear: (t: number) => number;\n    in: (t: number) => number;\n    out: (t: number) => number;\n    smooth: (t: number) => number;\n};\nexport type HoldSkin = {\n    root: HTMLElement;\n    button: HTMLElement;\n    hint?: HTMLElement | null;\n    render?(progress: number, state: HoldState): void;\n    start?(): void;\n    cancel?(): void;\n    tap?(): void;\n    refuse?(): void;\n    complete?(): void | Promise<void>;\n    reset?(): void;\n    dispose?(): void;\n};\nexport type HoldMessages = {\n    start: string;\n    cancel: string;\n    tap: string;\n    done: string;\n    refused: string;\n};\nexport type HoldOptions = {\n    duration?: number;\n    grace?: number;\n    drain?: number;\n    ease?: Ease;\n    keys?: string[];\n    cancelOnLeave?: boolean;\n    haptics?: boolean;\n    disabled?: boolean;\n    loop?: boolean;\n    announce?: boolean;\n    messages?: Partial<HoldMessages>;\n    onStart?(source: HoldSource): void;\n    onProgress?(progress: number, raw: number): void;\n    onCancel?(raw: number): void;\n    onTap?(): void;\n    onRefuse?(): void;\n    onComplete?(): void;\n    onBareClick?(): void;\n};\nexport declare const reducedMotion: () => boolean;\nexport declare function shake(el: HTMLElement): void;\nexport type Hold = ReturnType<typeof holdToConfirm>;\nexport declare function holdToConfirm(target: HTMLElement | HoldSkin, options?: HoldOptions): {\n    readonly state: HoldState;\n    readonly progress: number;\n    readonly raw: number;\n    options: {\n        duration: number;\n        grace: number;\n        drain: number;\n        ease: Ease;\n        keys: string[];\n        cancelOnLeave: boolean;\n        haptics: boolean;\n        disabled: boolean;\n        loop: boolean;\n        announce: boolean;\n        messages?: Partial<HoldMessages>;\n        onStart?(source: HoldSource): void;\n        onProgress?(progress: number, raw: number): void;\n        onCancel?(raw: number): void;\n        onTap?(): void;\n        onRefuse?(): void;\n        onComplete?(): void;\n        onBareClick?(): void;\n    };\n    press: () => void;\n    release: () => void;\n    reset: () => void;\n    step: (dt: number) => boolean;\n    setDisabled: (value: boolean) => void;\n    stop(): void;\n};"
        },
        {
          "file": "lift.ts",
          "declarations": "import { type HoldSkin } from './hold';\nexport type Plate = {\n    kg: number;\n    colour: string;\n    size: number;\n    thick: number;\n};\nexport declare const PLATES: Plate[];\nexport declare function loadSide(perSide: number, max?: number): Plate[];\nexport type LiftOptions = {\n    label: string;\n    doneLabel?: string;\n    hint?: string;\n    kg?: number;\n    grip?: string;\n};\nexport declare function lift(host: HTMLElement, options: LiftOptions): HoldSkin;"
        },
        {
          "file": "tunnel.ts",
          "declarations": "import { type HoldSkin } from './hold';\nexport type TunnelOptions = {\n    label: string;\n    doneLabel?: string;\n    hint?: string;\n    frames?: number;\n};\nexport declare const tunnelRate: (p: number) => number;\nexport declare function tunnel(host: HTMLElement, options: TunnelOptions): HoldSkin;"
        }
      ],
      "pitfalls": [
        "A screen reader in browse mode activates a button with a bare click, which cannot hold",
        "Never act on click: the core cancels the click itself",
        "Keep the hold short (about 0.8 to 1.5 s) and show progress from the first frame after the grace",
        "The grace is what makes a tap safe",
        "On touch the browser captures the pointer to the button",
        "navigator.vibrate works only after a user gesture and only on some platforms",
        "The light grid needs @property (registered in light-grid.css) for the tracer to spin",
        "The tunnel draws outside its dialog panel, behind it",
        "The tunnel’s frames and streaks are WAAPI animations whose playbackRate follows the hold",
        "Put the tunnel skin on the dialog panel and give the panel a background",
        "stop() also disposes the skin"
      ],
      "card": "entries/hold-to-confirm.json"
    },
    {
      "id": "humanoid-rig",
      "aliases": [],
      "name": "Drive any skinned humanoid",
      "summary": "One adapter that poses any humanoid skeleton, and a walk with no clips to drive it. The rig finds the bones by name (Mixamo’s, VRM’s, Unreal’s, Rigify’s or your own map), measures the body it is given (segments, hips, the heel, ball and toe of each foot) and poses it from one plain pose: feet as places on the ground, everything else relative to the body, two-bone IK with a pole for each limb, each foot turned to the ground’s normal and rolled about heel or ball, toes that bend, a pelvis lowered just enough for the legs to reach, fingers that close, and a ragdoll’s joints mapped back onto the bones. The gait writes that pose from how the body actually moved: heel, flat, ball and toe roll, each foot on the higher of heel and ball, sneak and crouch, turning on the spot by stepping, leaning into turns; stances (crouch, kneel, prone and a crawl) are poses solved from the body’s measurements and reached through kneeling and all fours; the motor under it walks a pace along the ground, slower up a hill, and refuses a bank too steep. A walker sculpted in Blender and loaded as a GLB (or, at a switch, the mannequin made in code) walks a test course of kerbs, a ramp, stairs, a hill, a bank and mounds.",
      "category": "simulation",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "balanced",
      "tags": [
        "humanoid",
        "skinned mesh",
        "skeleton",
        "retarget",
        "bone names",
        "mixamo",
        "inverse kinematics",
        "two-bone ik",
        "foot placement",
        "foot roll",
        "ground normal",
        "locomotion",
        "procedural animation",
        "gait",
        "sneak",
        "crouch",
        "kneel",
        "prone",
        "crawl",
        "turn on the spot",
        "slopes",
        "stairs",
        "step clearance",
        "toe clearance",
        "ragdoll mapping",
        "deterministic",
        "fixed timestep",
        "three.js",
        "no dependencies",
        "rests when idle"
      ],
      "useCases": [
        "a third-person character from any GLB (Mixamo, VRM, a game rig) walking with feet that land on the ground, no clips",
        "NPCs and crowds on stairs, kerbs, ramps and uneven ground without foot sliding",
        "putting hands and feet exactly where gameplay says: a hand on a rail, a foot on a pedal",
        "mapping a ragdoll or a physics body back onto a skinned mesh",
        "checking a new rig: which bones were found, its measurements, a sole estimated or measured",
        "a test course for tuning a walk: steps taken, a step refused, a hill, a bank too steep"
      ],
      "interaction": "Watch the tour, or drive: W A S D walk · Shift runs · C crouch · V kneel · Z prone · X sneak · Q E turn on the spot · tap the ground to walk there",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "pose-tiers",
          "why": "Ration live rig application by distance or screen size while motor and gait keep ticking"
        },
        {
          "id": "traversal",
          "why": "Vaults and climbs on the same rig"
        },
        {
          "id": "game-cameras",
          "why": "Over-the-shoulder cameras that follow it"
        },
        {
          "id": "crowd-bake",
          "why": "Baked crowds for figures far away"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 0.369,
          "cpuMs": 0.68,
          "cpuP95Ms": 0.97,
          "badge": "moderate",
          "drawCalls": 72,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 4.59,
            "p99Ms": 7.47,
            "low1Fps": 113.9
          },
          "notes": "The automatic tour at its own paces: the walk motor and the gait on the fixed 60 Hz tick, the skinned humanoid posed every frame by the rig (two-bone IK for each limb, feet on the ground’s normal), one SkinnedMesh of about 9,000 vertices, the course, foot contacts and prints, one shadowed key light and a room environment."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 2.097,
          "cpuMs": 1.385,
          "cpuP95Ms": 1.915,
          "badge": "heavy",
          "drawCalls": 68,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 625 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 1.842,
          "cpuMs": 0.34,
          "cpuP95Ms": 1.08,
          "badge": "moderate",
          "drawCalls": 69,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 662 ms."
        }
      ],
      "signatures": [
        {
          "file": "course.ts",
          "declarations": "export type Vec3 = {\n    x: number;\n    y: number;\n    z: number;\n};\ntype Lane = {\n    x0: number;\n    x1: number;\n};\nexport declare const COURSE_NEAR = -9;\nexport declare const COURSE_FAR = 22;\nexport declare const COURSE_LEFT = -15;\nexport declare const COURSE_RIGHT = 17;\nexport declare const COURSE_SECTIONS: ReadonlyArray<{\n    id: string;\n    label: string;\n    detail: string;\n    x0: number;\n    x1: number;\n    z0: number;\n    z1: number;\n}>;\nexport declare const COURSE_LANES: {\n    readonly kerb: Lane;\n    readonly ramp: Lane;\n    readonly stairs: Lane;\n    readonly hill: Lane;\n    readonly mounds: Lane;\n};\nexport declare const COURSE_START: {\n    x: number;\n    y: number;\n    z: number;\n    facing: number;\n};\nexport declare const COURSE_REACH = 0.35;\nexport declare function courseHeight(x: number, z: number, nearY?: number, reach?: number): number;\nexport declare function courseNormal(x: number, z: number, nearY?: number, reach?: number, out?: Vec3): Vec3;\nexport declare function offCourse(x: number, z: number): boolean;\nexport declare const COURSE_BODY_RADIUS = 0.3;\nexport declare function courseBlocked(x: number, z: number, feet: number, maxStep?: number, radius?: number): boolean;\nexport declare function courseWalkWorld(maxStep?: number): {\n    surfaceAt: (x: number, z: number, from: number, step?: number) => number;\n    blockedAt: (x: number, z: number, feet: number) => boolean;\n};\nexport declare const COURSE_GROUND: {\n    height: (x: number, z: number, nearY: number, reach?: number) => number;\n    normal: (x: number, z: number, nearY: number, reach: number, out: Vec3) => Vec3;\n};\nexport declare function courseSection(x: number, z: number): {\n    id: string;\n    label: string;\n    detail: string;\n    x0: number;\n    x1: number;\n    z0: number;\n    z1: number;\n} | null;\nexport type CourseTone = 'apron' | 'step' | 'ramp' | 'hill' | 'bank';\nexport type CourseBox = {\n    size: [\n        number,\n        number,\n        number\n    ];\n    position: [\n        number,\n        number,\n        number\n    ];\n    rotationX: number;\n    tone: CourseTone;\n};\nexport declare const COURSE_BOXES: CourseBox[];\nexport declare const COURSE_SLOPES: ReadonlyArray<{\n    x0: number;\n    x1: number;\n    z0: number;\n    y0: number;\n    z1: number;\n    y1: number;\n    tone: CourseTone;\n}>;\nexport declare const COURSE_MOUNDS: {\n    x0: number;\n    x1: number;\n    z0: number;\n    z1: number;\n};\nexport {};"
        },
        {
          "file": "gait.ts",
          "declarations": "import { type Vec3 } from './math';\nimport { type HumanoidPose } from './pose';\nimport type { HumanoidProfile } from './rig';\nexport type GaitMode = 'walk' | 'jog' | 'run' | 'sneak';\nexport type GaitInput = {\n    x: number;\n    y: number;\n    z: number;\n    vx: number;\n    vz: number;\n    facing: number;\n    grounded: boolean;\n    mode: GaitMode;\n    armsBusy?: number;\n    stepHeight?: number;\n};\nexport type GaitGround = {\n    height(x: number, z: number, nearY: number, reach?: number): number | null;\n    normal?(x: number, z: number, nearY: number, reach: number, out: Vec3): Vec3;\n};\ntype Curve = ReadonlyArray<readonly [\n    number,\n    number\n]>;\nexport type GaitStyle = {\n    cadence: Curve;\n    duty: Curve;\n    landing: Curve;\n    clearance: Curve;\n    strike: Curve;\n    push: Curve;\n    rollStart: Curve;\n    bob: Curve;\n    settle: Curve;\n    sway: Curve;\n    hipTurn: Curve;\n    lean: Curve;\n    armSwing: Curve;\n    elbowLift: Curve;\n    grip: Curve;\n    stanceWidth: number;\n    toeOut: number;\n    sneakCrouch: number;\n    sneakLean: number;\n    footTilt: number;\n};\nexport declare const DEFAULT_GAIT: GaitStyle;\nexport declare function curve(points: Curve, x: number): number;\nexport declare const CROUCH_WIDTH = 0.035;\nexport type FootStage = 'heel' | 'flat' | 'ball' | 'toe' | 'swing';\nexport type GaitFoot = {\n    planted: boolean;\n    heel: Vec3;\n    yaw: number;\n    normal: Vec3;\n    pitch: number;\n    toe: number;\n    pivot: number;\n    anchor: Vec3;\n    stage: FootStage;\n    from: Vec3;\n    fromPitch: number;\n    fromToe: number;\n    fromYaw: number;\n    fromNormal: Vec3;\n    to: Vec3;\n    toYaw: number;\n    toNormal: Vec3;\n    elapsed: number;\n    duration: number;\n    lift: number;\n    settling: boolean;\n    strike: number;\n    travel: number;\n};\nexport declare function soleVector(yaw: number, pitch: number, n: Vec3, length: number, out: Vec3): Vec3;\nexport type GaitBody = {\n    profile: HumanoidProfile;\n    scale: number;\n};\nexport declare class HumanoidGait {\n    phase: number;\n    touchdownMask: number;\n    cadence: number;\n    readonly feet: [\n        GaitFoot,\n        GaitFoot\n    ];\n    tempo: number;\n    crouchWant: number;\n    crouch: number;\n    get followGround(): boolean;\n    set followGround(on: boolean);\n    turning: boolean;\n    speed: number;\n    style: GaitStyle;\n    constructor(body: GaitBody, world: GaitGround, style?: GaitStyle);\n    reset(x: number, y: number, z: number, facing: number): void;\n    step(input: GaitInput, dt: number): void;\n    get settled(): boolean;\n    sample(alpha: number, out: HumanoidPose): HumanoidPose;\n    contacts(): [\n        boolean,\n        boolean\n    ];\n}\nexport {};"
        },
        {
          "file": "pose.ts",
          "declarations": "import { type Vec3 } from './math';\nexport type HumanoidLegPose = {\n    anchor: Vec3;\n    normal: Vec3;\n    yaw: number;\n    pitch: number;\n    toe: number;\n    pivot: number;\n    weight: number;\n    planted: boolean;\n    kneeOut: number;\n    pole: Vec3 | null;\n};\nexport type HumanoidArmPose = {\n    hand: Vec3;\n    pole: Vec3;\n    weight: number;\n    handRotation: Float64Array | null;\n    clavicleRaise: number;\n    clavicleForward: number;\n    grip: number;\n    thumb: number;\n};\nexport type HumanoidPose = {\n    pelvisOffset: Vec3;\n    pelvisYaw: number;\n    pelvisPitch: number;\n    pelvisRoll: number;\n    spineYaw: number;\n    spinePitch: number;\n    spineRoll: number;\n    headYaw: number;\n    headPitch: number;\n    headRoll: number;\n    armsFollow: number;\n    legs: [\n        HumanoidLegPose,\n        HumanoidLegPose\n    ];\n    arms: [\n        HumanoidArmPose,\n        HumanoidArmPose\n    ];\n};\nexport declare function createLegPose(): HumanoidLegPose;\nexport declare function createArmPose(): HumanoidArmPose;\nexport declare function createHumanoidPose(): HumanoidPose;\nexport declare const SIDE: readonly [\n    1,\n    -1\n];"
        },
        {
          "file": "rig.ts",
          "declarations": "import * as THREE from 'three';\nimport { type Vec3 } from './math';\nimport type { HumanoidLegPose, HumanoidPose } from './pose';\nexport declare const HUMANOID_BONES: readonly [\n    \"Hips\",\n    \"Spine\",\n    \"Chest\",\n    \"Neck\",\n    \"Head\",\n    \"ClavicleL\",\n    \"UpperArmL\",\n    \"LowerArmL\",\n    \"HandL\",\n    \"FingersL\",\n    \"ThumbL\",\n    \"ClavicleR\",\n    \"UpperArmR\",\n    \"LowerArmR\",\n    \"HandR\",\n    \"FingersR\",\n    \"ThumbR\",\n    \"UpperLegL\",\n    \"LowerLegL\",\n    \"FootL\",\n    \"ToeL\",\n    \"HeelL\",\n    \"BallL\",\n    \"ToeTipL\",\n    \"UpperLegR\",\n    \"LowerLegR\",\n    \"FootR\",\n    \"ToeR\",\n    \"HeelR\",\n    \"BallR\",\n    \"ToeTipR\"\n];\nexport type HumanoidBone = (typeof HUMANOID_BONES)[number];\nexport declare function normaliseBoneName(name: string): string;\nexport declare const BONE_ALIASES: Readonly<Record<HumanoidBone, readonly string[]>>;\nexport type SoleSource = 'markers' | 'toes' | 'estimated';\nexport type HumanoidProfile = {\n    legLength: number;\n    hipHeight: number;\n    hipWidth: number;\n    ankleHeight: number;\n    heelToBall: number;\n    ballToToe: number;\n    heelToAnkle: number;\n    armLength: number;\n    shoulderWidth: number;\n    shoulderHeight: number;\n    measuredSole: boolean;\n};\nexport type RigSnapshot = {\n    positions: THREE.Vector3[];\n    quaternions: THREE.Quaternion[];\n};\nexport type HumanoidRigOptions = {\n    names?: Partial<Record<HumanoidBone, string>>;\n};\nexport declare function findHumanoidBones(model: THREE.Object3D, options?: HumanoidRigOptions): Record<\"Hips\" | \"Spine\" | \"Chest\" | \"Neck\" | \"Head\" | \"ClavicleL\" | \"UpperArmL\" | \"LowerArmL\" | \"HandL\" | \"FingersL\" | \"ThumbL\" | \"ClavicleR\" | \"UpperArmR\" | \"LowerArmR\" | \"HandR\" | \"FingersR\" | \"ThumbR\" | \"UpperLegL\" | \"LowerLegL\" | \"FootL\" | \"ToeL\" | \"HeelL\" | \"BallL\" | \"ToeTipL\" | \"UpperLegR\" | \"LowerLegR\" | \"FootR\" | \"ToeR\" | \"HeelR\" | \"BallR\" | \"ToeTipR\", THREE.Bone<THREE.Object3DEventMap> | null>;\nexport declare class HumanoidRig {\n    readonly profile: HumanoidProfile;\n    readonly bones: Readonly<Record<HumanoidBone, string | null>>;\n    readonly sole: SoleSource;\n    unreachableMask: number;\n    pelvisDrop: number;\n    readonly model: THREE.Object3D;\n    readonly optional: ReadonlyArray<{\n        name: HumanoidBone;\n        present: boolean;\n    }>;\n    constructor(model: THREE.Object3D, options?: HumanoidRigOptions);\n    toModel(x: number, y: number, z: number, out: Vec3): Vec3;\n    worldScale(): number;\n    get segments(): {\n        thigh: number;\n        shin: number;\n        upperArm: number;\n        forearm: number;\n    };\n    reset(): void;\n    refineArm(pose: HumanoidPose, index: 0 | 1): void;\n    apply(pose: HumanoidPose, dt: number): void;\n    restBody(): {\n        thigh: number;\n        shin: number;\n        upperArm: number;\n        forearm: number;\n        hips: Vec3;\n        spine: Vec3;\n        chest: Vec3;\n        legRoots: [\n            Vec3,\n            Vec3\n        ];\n        shoulders: [\n            Vec3,\n            Vec3\n        ];\n        ankles: [\n            Vec3,\n            Vec3\n        ];\n        ballY: number;\n        ballZ: number;\n    };\n    legFromModel(side: 0 | 1, ankle: Vec3, yaw: number, pitch: number, toe: number, pole: Vec3, pivot: number, out: HumanoidLegPose): HumanoidLegPose;\n    restJoint(side: 0 | 1, which: 'ankle' | 'hip', out: Vec3): Vec3;\n    ankleGoal(side: 0 | 1, leg: HumanoidLegPose, out: THREE.Vector3): THREE.Vector3;\n    solePoint(side: 0 | 1, which: 'heel' | 'ball' | 'toeTip', out: THREE.Vector3): THREE.Vector3;\n    captureJoints(): {\n        names: (\"Hips\" | \"Spine\" | \"Chest\" | \"Neck\" | \"Head\" | \"ClavicleL\" | \"UpperArmL\" | \"LowerArmL\" | \"HandL\" | \"FingersL\" | \"ThumbL\" | \"ClavicleR\" | \"UpperArmR\" | \"LowerArmR\" | \"HandR\" | \"FingersR\" | \"ThumbR\" | \"UpperLegL\" | \"LowerLegL\" | \"FootL\" | \"ToeL\" | \"HeelL\" | \"BallL\" | \"ToeTipL\" | \"UpperLegR\" | \"LowerLegR\" | \"FootR\" | \"ToeR\" | \"HeelR\" | \"BallR\" | \"ToeTipR\")[];\n        parents: Int16Array<ArrayBuffer>;\n        positions: Float64Array<ArrayBuffer>;\n    };\n    applyRagdoll(positions: Float64Array): void;\n    snapshot(): RigSnapshot;\n    blendFrom(from: RigSnapshot, weight: number): void;\n}"
        },
        {
          "file": "stance.ts",
          "declarations": "import { type Vec3 } from './math';\nimport type { HumanoidPose } from './pose';\nimport type { HumanoidRig } from './rig';\nexport type Stance = 'stand' | 'crouch' | 'kneel' | 'prone';\nexport declare const STANCES: readonly Stance[];\nexport type StanceBody = {\n    thigh: number;\n    shin: number;\n    upperArm: number;\n    forearm: number;\n    hips: Vec3;\n    spine: Vec3;\n    chest: Vec3;\n    legRoots: [\n        Vec3,\n        Vec3\n    ];\n    shoulders: [\n        Vec3,\n        Vec3\n    ];\n    ankles: [\n        Vec3,\n        Vec3\n    ];\n    ballY: number;\n    ballZ: number;\n    stanceWidth: number;\n};\nexport type StanceState = {\n    stance: Stance;\n    shown: Stance;\n    transition: number;\n    speedLimit: number;\n    moving: 'still' | 'walk' | 'shuffle' | 'crawl';\n};\nexport declare const STANCE_SPEED: {\n    readonly crouch: 1.5;\n    readonly shuffle: 0.9;\n    readonly crawl: 0.5;\n};\ntype Node = 'gait' | 'kneel' | 'allFours' | 'prone';\nexport type KeyLeg = {\n    ankle: Vec3;\n    yaw: number;\n    pitch: number;\n    toe: number;\n    pole: Vec3;\n};\nexport type KeyArm = {\n    weight: number;\n    hand: Vec3;\n    pole: Vec3;\n};\nexport type StanceKey = {\n    pelvis: Vec3;\n    pelvisPitch: number;\n    pelvisYaw: number;\n    pelvisRoll: number;\n    spinePitch: number;\n    spineYaw: number;\n    spineRoll: number;\n    headPitch: number;\n    headYaw: number;\n    legs: [\n        KeyLeg,\n        KeyLeg\n    ];\n    arms: [\n        KeyArm,\n        KeyArm\n    ];\n};\nexport declare function createStanceKey(): StanceKey;\nexport declare function stanceBodyFromRig(rig: HumanoidRig, stanceWidth?: number): StanceBody;\nexport declare function legRoot(body: StanceBody, t: StanceKey, side: 0 | 1, out: Vec3): Vec3;\nexport declare function shoulderAt(body: StanceBody, t: StanceKey, side: 0 | 1, out: Vec3): Vec3;\nexport declare function toesDownPitch(body: StanceBody, height: number): number;\nexport declare function kneelKey(body: StanceBody, front: {\n    x: number;\n    z: number;\n    yaw: number;\n}, out: StanceKey): StanceKey;\nexport declare function allFoursKey(body: StanceBody, out: StanceKey): StanceKey;\nexport declare function proneKey(body: StanceBody, out: StanceKey, chest?: number, crawl?: number, knees?: readonly number[], kneeLift?: readonly number[], elbows?: readonly number[], elbowLift?: readonly number[]): StanceKey;\nexport declare function blendKeys(a: StanceKey, b: StanceKey, u: number, out: StanceKey): StanceKey;\nexport type StanceTick = {\n    speed: number;\n    localX: number;\n    localZ: number;\n};\nexport declare class StanceController {\n    readonly state: StanceState;\n    crouch: number;\n    weight: number;\n    readonly key: StanceKey;\n    node: Node;\n    to: Node | null;\n    scale: number;\n    readonly front: {\n        x: number;\n        z: number;\n        yaw: number;\n    };\n    readonly body: StanceBody;\n    constructor(body: StanceBody);\n    request(stance: Stance): void;\n    reset(): void;\n    get busy(): boolean;\n    tick(dt: number, input: StanceTick): void;\n}\nexport declare function layStance(stance: StanceController, rig: HumanoidRig, pose: HumanoidPose): HumanoidPose;\nexport {};"
        },
        {
          "file": "walk.ts",
          "declarations": "export type WalkInput = {\n    x: number;\n    z: number;\n    speed: number;\n    face?: number;\n    faceRate?: number;\n    push?: {\n        x: number;\n        z: number;\n    };\n};\nexport type WalkWorld = {\n    surfaceAt(x: number, z: number, from: number, step?: number): number;\n    blockedAt?(x: number, z: number, feet: number): boolean;\n};\nexport type WalkSettings = {\n    acceleration: number;\n    braking: number;\n    maxStepHeight: number;\n    turnRate: number;\n    faceRate: number;\n};\nexport declare const WALK_DEFAULTS: WalkSettings;\nexport declare const FALL_SPEED = 9;\nexport type WalkState = {\n    x: number;\n    y: number;\n    z: number;\n    facing: number;\n    speed: number;\n    vx: number;\n    vz: number;\n    moveX: number;\n    moveZ: number;\n    blockedX: boolean;\n    blockedZ: boolean;\n    grounded: boolean;\n    grade: number;\n    refused: number;\n    pace: number;\n};\nexport declare function startWalking(x: number, y: number, z: number, facing?: number): WalkState;\nexport declare const SLOPE: {\n    readonly probe: 0.6;\n    readonly behind: 0.6;\n    readonly climb: 0.45;\n    readonly descent: 0.4;\n    readonly easyDescent: 0.15;\n    readonly refuse: number;\n    readonly steepest: number;\n    readonly braked: 2.5;\n    readonly drop: 1.2;\n    readonly stairCadence: 3;\n    readonly stairRise: 0.3;\n    readonly stairProbe: 1.3;\n};\nexport declare function slopeEffort(grade: number): number;\nexport declare function slopePace(grade: number): number;\ntype Hill = {\n    x: number;\n    z: number;\n    pace: number;\n    effort: number;\n    refused: number;\n    upX: number;\n    upZ: number;\n    grade: number;\n    stairs: number;\n};\nexport declare function stairPace(world: WalkWorld, state: {\n    x: number;\n    y: number;\n    z: number;\n}, dx: number, dz: number): number;\nexport declare function hill(world: WalkWorld, state: {\n    x: number;\n    y: number;\n    z: number;\n}, dx: number, dz: number, way?: Hill): Hill;\nexport declare function walkStep(state: WalkState, input: WalkInput, delta: number, world: WalkWorld, settings?: WalkSettings, out?: WalkState): WalkState;\nexport declare function stickDirection(axes: readonly number[], cameraYaw: number, deadzone?: number): {\n    x: number;\n    z: number;\n} | null;\nexport declare function screenToWorld(forward: number, right: number, cameraYaw: number): {\n    x: number;\n    z: number;\n};\nexport {};"
        }
      ],
      "pitfalls": [
        "The model must stand on its own origin at rest, facing +Z, its left +X, the soles on y = 0",
        "Never let an AnimationMixer write the same bones in the same frame",
        "Bones are compared by normalised name",
        "Lengths are measured once, at construction, from the rest pose the model is in then",
        "Clone a skinned model per body with SkeletonUtils.clone, never Object3D.clone",
        "A foot tilts to the ground only where heel and ball agree with the normal (within 3 cm)",
        "The gait reads edges by asking height() along lines a few centimetres apart",
        "The hips stand over the planted feet, not over the motor’s y",
        "On stairs the stride is a whole number of treads and the pace has to allow one tread a step",
        "The gait runs on fixed ticks of at most 1/30 s",
        "A course or world that answers \"the one below\" for a point inside a slope makes the walk read a…",
        "Stances assume level ground under the body",
        "The demo’s default figure is a 250 KB GLB loaded at start (walker.glb, imported with ?url)",
        "The rig allocates nothing per frame, but apply() costs a bone-matrix walk per limb"
      ],
      "card": "entries/humanoid-rig.json"
    },
    {
      "id": "icons-to-3d",
      "aliases": [],
      "name": "SVG icons to 3D",
      "summary": "Any stroke icon (or filled one) as a solid you can light and turn. The SVG is read by a strict parser of its own and rebuilt from plain shapes only, so scripts, event handlers, links and outside fills never get through, and every refusal says why in plain words. Strokes become filled outlines at any weight, round-capped and joined into one shape with their holes kept, by a distance field and marching squares instead of a polygon-clipping library. The outline is extruded with a bevel cut inward, so the silhouette keeps its size, inside budgets for elements, points and vertices.",
      "category": "technique",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "balanced",
      "tags": [
        "svg",
        "icons",
        "extrude",
        "bevel",
        "stroke to outline",
        "offset",
        "polygon union",
        "distance field",
        "marching squares",
        "sanitise",
        "untrusted input",
        "detail budget",
        "ExtrudeGeometry",
        "three.js",
        "no dependencies"
      ],
      "useCases": [
        "a logo or icon as a 3D object in a scene or a title",
        "letting people drop in their own SVG without trusting it",
        "stroke icon sets (24-unit grid, round caps) turned into solids at any weight",
        "a stroke icon as filled outlines, for a cutter, an embroidery file or a font",
        "badges, trophies and buttons extruded from a 2D mark",
        "checking a pasted SVG before anything renders it"
      ],
      "interaction": "Pick an icon · drag to turn it · set depth and bevel in Controls · paste your own SVG",
      "kits": [],
      "pairsWith": [
        {
          "id": "card-material",
          "why": "Metal, clearcoat and foil finishes"
        },
        {
          "id": "material-designer",
          "why": "Your own materials on the solids"
        },
        {
          "id": "camera-director",
          "why": "Shots round the turning icon"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 0.207,
          "cpuMs": 0.235,
          "cpuP95Ms": 0.565,
          "badge": "light",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.51,
            "p99Ms": 7.135,
            "low1Fps": 91.1
          },
          "notes": "Measured turning the star (about 1,900 triangles, enamel with clearcoat, image-based light from a room environment) and rebuilding it from the SVG twice a second, at stroke weights that change each time."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.524,
          "cpuMs": 0.445,
          "cpuP95Ms": 0.62,
          "badge": "moderate",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 471 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 1.546,
          "cpuMs": 0.1,
          "cpuP95Ms": 0.34,
          "badge": "moderate",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 469 ms."
        }
      ],
      "signatures": [
        {
          "file": "icons-to-3d.ts",
          "declarations": "import type { BufferGeometry } from 'three';\nimport { type Outline, type OutlineOptions } from './outline';\nimport { type ExtrudeOptions, type ExtrudeStats } from './extrude';\nimport type { IconDrawing } from './svg-lines';\nexport { IconError, cleanSvg, parseSvg, serializeSvg, type SvgEl } from './svg-clean';\nexport { readIcon, type IconDrawing, type IconShape, type Pt, type Subpath, type ViewBox } from './svg-lines';\nexport { outlineDrawing, outlinesPath, outlinesSvg, ringArea, strokeOutlines, type Outline, type OutlineOptions, type StrokeLine } from './outline';\nexport { extrudeOutlines, outlinesToShapes, type ExtrudeOptions, type ExtrudeStats } from './extrude';\nexport type IconSolid = {\n    clean: string;\n    dropped: string[];\n    drawing: IconDrawing;\n    outlines: Outline[];\n    solidSvg: string;\n    geometry: BufferGeometry;\n    stats: ExtrudeStats & {\n        outlinePoints: number;\n        ms: number;\n    };\n};\nexport declare function iconToSolid(source: string, options?: OutlineOptions & ExtrudeOptions): IconSolid;"
        }
      ],
      "pitfalls": [
        "Never put the pasted SVG into the page, not even as an <img>",
        "Refuse what changes the picture, drop what does not",
        "Caps and joins are always round, whatever stroke-linecap says",
        "Stroke icons say fill=\"none\" on the root and filled ones say nothing",
        "The outline’s precision is the field’s cell (detail 512: 1/20 of a unit on a 24-unit icon)",
        "A bevel cut inward from both sides of a stroke meets in the middle at half the stroke’s width…",
        "Conversion is synchronous",
        "Dispose the old geometry when you swap in a new one"
      ],
      "card": "entries/icons-to-3d.json"
    },
    {
      "id": "impact-plates",
      "aliases": [],
      "name": "Impacts the whole page feels",
      "summary": "One event, felt everywhere: impact({ x, y, mass }) makes every [data-body] element dip, rock and ring down on its shock mounts by its distance and its own mass, throws sparks that bounce off the plates’ edges (so they shower down the gaps, never across the words), lights the rims of plates near a hot hit, and sounds a thud whose pitch and length follow the mass. All of it runs on one deterministic clock of tagged tweens and timers that can be paused and stepped, and a turret you spin by hand chooses with inertia, detents and ratchet clicks.",
      "category": "ui",
      "role": "interaction",
      "stack": [
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "impact",
        "weight",
        "springs",
        "shake",
        "sparks",
        "particles",
        "canvas 2d",
        "web audio",
        "sound",
        "tween clock",
        "deterministic",
        "pause and step",
        "dial",
        "spinner",
        "detents",
        "inertia",
        "radiogroup",
        "keyboard",
        "touch",
        "reduced motion",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "dashboards and control rooms where an alarm or a big number lands with weight",
        "games and toys: drops, slams and hits the interface itself feels",
        "drag and drop that lands heavily",
        "a choice with a physical feel: a selector wheel, a carousel of modes",
        "animations that must be paused, stepped and replayed exactly (tests, captures, tutorials)"
      ],
      "interaction": "Spin the turret to choose a weight, then click the bench to drop it · Sound starts off",
      "kits": [
        {
          "kit": "shop",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "ui-sounds",
          "why": "A clunk and a ring with each impact"
        },
        {
          "id": "micro-interactions",
          "why": "Toasts and shakes for the same events"
        },
        {
          "id": "comic-text",
          "why": "A sound-effect word at the hit"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "calm",
          "in": "module",
          "values": {
            "strict": true,
            "refined": false,
            "playful": false
          },
          "note": "things go straight to where they end"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": null,
          "cpuMs": 0.815,
          "cpuP95Ms": 1.405,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.84,
            "p99Ms": 18.065,
            "low1Fps": 54.8
          },
          "notes": "Measured with the demo dropping weights by itself from its first frame and every 0.35 s after, hot hits from brick to anvil at seeded spots, so through the whole run plates ring on their springs, hundreds of sparks bounce off their edges, dust spreads, rims glow and the turret turns to each weight. The system is stepped from the demo’s update(), so the CPU time is all of it: the clock, the springs’ transform writes, the spark simulation and the Canvas 2D drawing. No GPU of its own."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 1.295,
          "cpuP95Ms": 2.1,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 28 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.76,
          "cpuP95Ms": 1.6,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 161 ms."
        }
      ],
      "signatures": [
        {
          "file": "clock.ts",
          "declarations": "export declare const ease: {\n    linear: (x: number) => number;\n    heavy: (x: number) => number;\n    slam: (x: number) => number;\n    out: (x: number) => number;\n    settle: (x: number) => number;\n    windup: (x: number) => number;\n    servo: (x: number) => number;\n};\nexport type Ease = (x: number) => number;\nexport type TweenOptions<T> = {\n    ease?: Ease;\n    at?: number;\n    tag?: string;\n    on?: (obj: T, x: number) => void;\n    done?: () => void;\n};\nexport type Stepper = (dt: number) => boolean;\nexport type Clock = {\n    readonly t: number;\n    scale: number;\n    calm: boolean;\n    readonly paused: boolean;\n    tw<T extends object>(obj: T, to: Partial<Record<keyof T, number>>, d: number, opt?: TweenOptions<T>): void;\n    after(delay: number, fn: () => void, tag?: string): void;\n    kill(tag: string): void;\n    busy(): boolean;\n    busyTag(tag: string): boolean;\n    use(step: Stepper): () => void;\n    step(dt: number): boolean;\n    pause(): void;\n    resume(): void;\n    advance(ms: number): boolean;\n    onStep: (() => void) | null;\n};\nexport declare function createClock(): Clock;\nexport declare function spring(o: Record<string, number>, key: string, to: number, k: number, c: number, dt: number): boolean;"
        },
        {
          "file": "impact.ts",
          "declarations": "import { type Clock } from './clock';\nimport { type Impact, type Plates } from './plates';\nimport { type SparkLayer } from './sparks';\nimport { type Thud } from './thud';\nexport type ImpactsOptions = {\n    root: HTMLElement;\n    clock?: Clock;\n    theme?: () => 'dark' | 'light';\n    hot?: Record<string, string>;\n    seed?: number;\n    loop?: boolean;\n};\nexport type Impacts = {\n    readonly clock: Clock;\n    readonly plates: Plates;\n    readonly sparks: SparkLayer;\n    readonly sound: Thud;\n    frame(dt: number): boolean;\n    impact(e: Impact): number;\n    onImpact(fn: (e: Impact & {\n        mass: number;\n    }) => void): () => void;\n    measure(): void;\n    dispose(): void;\n};\nexport declare function createImpacts(o: ImpactsOptions): Impacts;"
        },
        {
          "file": "turret.ts",
          "declarations": "import { type Clock } from './clock';\nexport type TurretItem = {\n    label: string;\n    detail?: string;\n};\nexport type TurretOptions = {\n    clock: Clock;\n    items: TurretItem[];\n    label: string;\n    value?: number;\n    onChange?(index: number, item: TurretItem): void;\n    onTick?(at: {\n        x: number;\n        y: number;\n    }): void;\n    onLock?(at: {\n        x: number;\n        y: number;\n    }, index: number): void;\n};\nexport type Turret = {\n    select(i: number): void;\n    spin(steps: number): void;\n    readonly value: number;\n    layout(): void;\n    dispose(): void;\n};\nexport declare function createTurret(host: HTMLElement, o: TurretOptions): Turret;"
        }
      ],
      "pitfalls": [
        "The plates own their transform while they ring",
        "Plates are measured against the root at register() and on a resize of the root",
        "Hits come in client px (event.clientX and clientY)",
        "The sparks layer is a canvas over the whole root at z-index 4",
        "Sound starts off and needs a click",
        "Everything moves on the clock",
        "Under reduced motion (clock.calm) plates stay put and no sparks fly",
        "The turret is a radiogroup",
        "One frame loop runs only while something moves and stops by itself"
      ],
      "card": "entries/impact-plates.json"
    },
    {
      "id": "infinite-canvas",
      "aliases": [],
      "name": "Infinite-canvas core",
      "summary": "The parts of a zoomable board that make it feel right: render on demand (no frame while nothing changes), a wheel reader that tells trackpad pans and pinches from mouse notches, a spatial index, a culling window, smooth zoom, flights and reveals by the least move, and a dot grid that keeps its density at any zoom.",
      "category": "canvas",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "calm",
      "tags": [
        "pan and zoom",
        "render on demand",
        "spatial index",
        "culling",
        "wheel",
        "trackpad",
        "dot grid",
        "instancing"
      ],
      "useCases": [
        "whiteboards and canvas apps",
        "node editors",
        "maps and floor plans",
        "design tools",
        "large dashboards"
      ],
      "interaction": "Click the board, then scroll or pinch to zoom · drag to pan · double-click to fly in · Add a card off screen glides just far enough to show it",
      "kits": [],
      "pairsWith": [
        {
          "id": "smart-guides",
          "why": "Snapping and handles for the cards"
        },
        {
          "id": "sdf-text",
          "why": "Text that stays crisp at any zoom"
        },
        {
          "id": "connectors-layouts",
          "why": "Arrows routed between the cards"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 0.102,
          "cpuMs": 0.327,
          "cpuP95Ms": 0.49,
          "badge": "light",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured while the view wanders round a cluster and zooms in and out, so every frame draws (20,000 cards on the board, culled to the view). Idle, render on demand draws no frame at all: 0 ms. The index is asked again only when the view leaves the culled region."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.049,
          "cpuMs": 0.678,
          "cpuP95Ms": 1.135,
          "badge": "moderate",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 124 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 1.1,
          "cpuMs": 0.22,
          "cpuP95Ms": 0.28,
          "badge": "moderate",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 133 ms."
        }
      ],
      "signatures": [
        {
          "file": "camera.ts",
          "declarations": "export type Camera = {\n    x: number;\n    y: number;\n    zoom: number;\n};\nexport type Viewport = {\n    width: number;\n    height: number;\n};\nexport type Vec2 = {\n    x: number;\n    y: number;\n};\nexport type Rect = {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n};\nexport declare const MIN_ZOOM = 0.02;\nexport declare const MAX_ZOOM = 32;\nexport declare const ZOOM_STEPS: number[];\nexport declare const clampZoom: (zoom: number) => number;\nexport declare function screenToWorld(cam: Camera, vp: Viewport, p: Vec2): Vec2;\nexport declare function worldToScreen(cam: Camera, vp: Viewport, p: Vec2): Vec2;\nexport declare function panBy(cam: Camera, dx: number, dy: number): Camera;\nexport declare function zoomAbout(cam: Camera, vp: Viewport, anchor: Vec2, zoom: number): Camera;\nexport declare function visibleRect(cam: Camera, vp: Viewport): Rect;\nexport declare function fitRect(rect: Rect, vp: Viewport, padding?: number, maxZoom?: number): Camera;\nexport type Insets = {\n    left?: number;\n    top?: number;\n    right?: number;\n    bottom?: number;\n};\nexport declare function revealRect(cam: Camera, vp: Viewport, rect: Rect, insets?: Insets, margin?: number): Camera;\nexport declare function stepZoom(zoom: number, direction: 1 | -1): number;\nexport declare function approachZoom<C extends Camera>(cam: C, vp: Viewport, anchor: Vec2, target: number, dt: number, rate?: number, about?: (c: C, vp: Viewport, a: Vec2, z: number) => C): {\n    camera: C;\n    done: boolean;\n};\nexport declare function lerpCamera<C extends Camera & {\n    yaw?: number;\n    pitch?: number;\n}>(a: C, b: C, t: number): C;\nexport declare const easeInOut: (t: number) => number;\nexport declare const rectsIntersect: (a: Rect, b: Rect) => boolean;\nexport declare const rectContains: (outer: Rect, inner: Rect) => boolean;\nexport declare const pointInRect: (p: Vec2, r: Rect) => boolean;\nexport declare function boundsOf(rects: Iterable<Rect>): Rect | null;"
        },
        {
          "file": "cull.ts",
          "declarations": "import { type Rect } from './camera';\nexport declare class CullWindow {\n    region: Rect | null;\n    constructor(pad?: number, shrink?: number);\n    stale(view: Rect): boolean;\n    around(view: Rect): Rect;\n    invalidate(): void;\n}"
        },
        {
          "file": "dot-grid.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { type Camera, type Viewport } from './camera';\nexport declare class DotGrid {\n    readonly mesh: THREE.Mesh;\n    readonly minor: THREE.UniformNode<\"float\", number>;\n    readonly major: THREE.UniformNode<\"float\", number>;\n    readonly minorAlpha: THREE.UniformNode<\"float\", number>;\n    readonly origin: THREE.UniformNode<\"vec2\", THREE.Vector2>;\n    readonly span: THREE.UniformNode<\"vec2\", THREE.Vector2>;\n    readonly scale: THREE.UniformNode<\"float\", number>;\n    readonly dpr: THREE.UniformNode<\"float\", number>;\n    readonly size: THREE.UniformNode<\"float\", number>;\n    readonly paper: THREE.UniformNode<\"color\", THREE.Color>;\n    readonly ink: THREE.UniformNode<\"color\", THREE.Color>;\n    constructor();\n    update(cam: Camera, vp: Viewport, dpr: number, base?: number): void;\n}"
        },
        {
          "file": "scheduler.ts",
          "declarations": "export type FrameHost = {\n    request(callback: (time: number) => void): number;\n    cancel(handle: number): void;\n};\nexport declare class FrameScheduler {\n    frames: number;\n    constructor(draw: (dt: number, time: number) => boolean, host?: FrameHost);\n    get pending(): boolean;\n    invalidate(): void;\n    dispose(): void;\n}"
        },
        {
          "file": "spatial.ts",
          "declarations": "import { type Rect, type Vec2 } from './camera';\nexport declare class SpatialIndex {\n    readonly cellSize: number;\n    constructor(cellSize?: number);\n    get size(): number;\n    has(id: string): boolean;\n    rectOf(id: string): Rect | undefined;\n    set(id: string, rect: Rect): void;\n    delete(id: string): void;\n    clear(): void;\n    query(area: Rect): string[];\n    at(p: Vec2, slop?: number): string[];\n}"
        },
        {
          "file": "wheel.ts",
          "declarations": "export type WheelInput = {\n    deltaX: number;\n    deltaY: number;\n    deltaMode: number;\n    ctrlKey: boolean;\n    metaKey: boolean;\n    shiftKey: boolean;\n    timeStamp: number;\n    dpr?: number;\n};\nexport type WheelIntent = {\n    kind: 'zoom';\n    factor: number;\n    smooth: boolean;\n} | {\n    kind: 'pan';\n    dx: number;\n    dy: number;\n};\nexport declare class WheelReader {\n    read(e: WheelInput): WheelIntent;\n}"
        }
      ],
      "pitfalls": [
        "A mouse notch is a round number of the screen’s own pixels",
        "A fast trackpad flick sends notch-sized deltas",
        "Keep the grid’s world origin small (positiveMod against the coarse spacing)",
        "Query the index for a region larger than the view and only again when the view leaves it",
        "Huge items spanning more than 64 cells go in one list every query checks",
        "Render on demand means nothing animates by itself",
        "Showing something new or off screen",
        "Capture the wheel only once the board has been clicked (or is full screen)"
      ],
      "card": "entries/infinite-canvas.json"
    },
    {
      "id": "ink-strokes",
      "aliases": [],
      "name": "Pen ink that tidies into shapes",
      "summary": "Freehand ink from a mouse, a finger or a pen: smoothed as it arrives, widened by pen pressure, simplified when the pen lifts (Ramer–Douglas–Peucker, pressure counted), and drawn as one filled outline of capsules, so see-through ink never darkens where it crosses itself. On request a rough line, arrow, box, circle, ellipse, triangle or diamond becomes a clean one, conservatively (when in doubt it stays ink), with a head drawn onto a line making it an arrow, near-round snapping to a circle and near-level lines to 15° steps, and the ink morphing into its shape. Pure and tested, no dependencies.",
      "category": "canvas",
      "role": "interaction",
      "stack": [
        "canvas2d"
      ],
      "character": "calm",
      "tags": [
        "ink",
        "pen",
        "stylus",
        "pressure",
        "freehand",
        "handwriting",
        "smoothing",
        "simplification",
        "ramer-douglas-peucker",
        "shape recognition",
        "quick shape",
        "arrow",
        "snap",
        "morph",
        "highlighter",
        "palm rejection",
        "pointer events",
        "coalesced events",
        "canvas 2d",
        "svg path",
        "undo",
        "accessibility",
        "no dependencies"
      ],
      "useCases": [
        "a pen or highlighter on a whiteboard or canvas app",
        "sketching diagrams that come out clean",
        "annotating screenshots, slides or documents",
        "signatures and handwritten notes",
        "a stylus on a tablet with the palm resting on the screen",
        "ink saved or exported as SVG"
      ],
      "interaction": "Write with a mouse, a finger or a pen · draw a rough circle, box, triangle, line or arrow · Ctrl Z undoes a stroke, T toggles tidying",
      "kits": [],
      "pairsWith": [
        {
          "id": "brush-tips",
          "why": "Textured tips along the strokes"
        },
        {
          "id": "infinite-canvas",
          "why": "A zoomable board to write on"
        },
        {
          "id": "smart-guides",
          "why": "Snap the shapes it tidies into"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "canvas2d",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": null,
          "cpuMs": 0.19,
          "cpuP95Ms": 0.52,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 30.303,
            "p99Ms": 32.18,
            "low1Fps": 31
          },
          "notes": "Measured writing by itself: the seven sample strokes drawn point by point, recognised and morphed into shapes, then the sheet cleared and drawn again. Idle, nothing is drawn."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.245,
          "cpuP95Ms": 0.55,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 71 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.3,
          "cpuP95Ms": 0.46,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 150 ms."
        }
      ],
      "signatures": [
        {
          "file": "ink-draw.ts",
          "declarations": "import type { Recognized } from './recognize';\nimport { type InkPoint, type Vec2 } from './stroke';\nexport type PathSink = {\n    moveTo(x: number, y: number): void;\n    lineTo(x: number, y: number): void;\n    arc(x: number, y: number, r: number, a0: number, a1: number): void;\n    closePath(): void;\n};\nexport declare function traceInk(sink: PathSink, points: readonly InkPoint[], base: number): void;\nexport declare function svgPath(digits?: number): PathSink & {\n    d(): string;\n};\nexport declare function shapeOutline(s: Recognized, ellipseSteps?: number): {\n    points: Vec2[];\n    closed: boolean;\n};\nexport declare function arrowHeads(s: Recognized, size: number): Vec2[][];\nexport declare function traceShape(sink: PathSink, s: Recognized, headSize: number): void;\nexport type MorphPlan = {\n    from: InkPoint[];\n    to: InkPoint[];\n    closed: boolean;\n};\nexport declare function morphPlan(ink: readonly InkPoint[], s: Recognized, n?: number): MorphPlan;\nexport declare function morphAt(plan: MorphPlan, t: number): InkPoint[];"
        },
        {
          "file": "ink-recorder.ts",
          "declarations": "import { type InkPoint } from './stroke';\nexport declare const HOLD_SLOP = 4;\nexport declare const HOLD_TO_TIDY = 300;\nexport type RecorderOptions = {\n    lag?: number;\n    step?: number;\n    tolerance?: number;\n};\nexport declare function pressureOf(e: {\n    pointerType: string;\n    pressure: number;\n}): number;\nexport declare class InkRecorder {\n    constructor(opts?: RecorderOptions);\n    get active(): boolean;\n    get points(): readonly InkPoint[];\n    set(opts: RecorderOptions): void;\n    begin(x: number, y: number, p: number, now?: number): void;\n    add(x: number, y: number, p: number, zoom?: number, now?: number): boolean;\n    end(zoom?: number, now?: number): {\n        points: InkPoint[];\n        raw: InkPoint[];\n        held: number;\n    };\n    cancel(): void;\n}"
        },
        {
          "file": "recognize.ts",
          "declarations": "import { type Vec2 } from './stroke';\nexport type Recognized = {\n    kind: 'line';\n    from: Vec2;\n    to: Vec2;\n} | {\n    kind: 'arrow';\n    from: Vec2;\n    to: Vec2;\n    double?: boolean;\n} | {\n    kind: 'rect' | 'ellipse' | 'diamond';\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n} | {\n    kind: 'triangle';\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n    points: [\n        Vec2,\n        Vec2,\n        Vec2\n    ];\n};\nexport type RecognizeOptions = {\n    looseness?: number;\n    snap?: boolean;\n};\nexport declare function recognize(points: readonly Vec2[], opts?: RecognizeOptions): Recognized | null;\nexport declare function arrowHeadFor(points: readonly Vec2[], line: {\n    from: Vec2;\n    to: Vec2;\n}): 'from' | 'to' | null;\nexport declare function snapShape(s: Recognized): Recognized;\nexport declare function shapeName(s: Recognized): string;"
        },
        {
          "file": "stroke.ts",
          "declarations": "export type Vec2 = {\n    x: number;\n    y: number;\n};\nexport type InkPoint = {\n    x: number;\n    y: number;\n    p: number;\n};\nexport declare function follow(prev: InkPoint | null, next: InkPoint, lag?: number): InkPoint;\nexport declare function simplifyStroke(points: readonly InkPoint[], tolerance: number): InkPoint[];\nexport declare function distanceToSegment(p: Vec2, a: Vec2, b: Vec2): number;\nexport declare const widthAt: (base: number, pressure: number) => number;\nexport declare function strokeBounds(points: readonly Vec2[]): {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n};\nexport declare function pathLength(points: readonly Vec2[], closed?: boolean): number;\nexport declare function resample(points: readonly InkPoint[], n: number, closed?: boolean): InkPoint[];"
        }
      ],
      "pitfalls": [
        "Read pressure only from pens (`pointerType === \"pen\"`)",
        "Recognise the whole smoothed path (`raw` from InkRecorder.end), not the simplified points",
        "Smoothing trails the pointer",
        "Fill a stroke once, as one outline",
        "Simplify in screen pixels (`tolerance / zoom`)",
        "Use getCoalescedEvents for pens",
        "Recognition is deliberately conservative, and should stay so",
        "Check a new stroke against nearby lines for an arrow head before recognising it on its own",
        "Once a pen has touched the sheet, ignore touch pointers for ink",
        "End the stroke on lostpointercapture too",
        "Set `touch-action: none` on the canvas"
      ],
      "card": "entries/ink-strokes.json"
    },
    {
      "id": "instance-cull",
      "aliases": [],
      "name": "CPU culling for instanced batches",
      "summary": "Cull spatial batches with one enclosing sphere, test individual instances only at the view edge, and pack visible rows in stable source order. Unchanged selections skip copies and uploads; empty batches can skip draws entirely. Matrices, colours and other Float32 instance attributes share the same selection.",
      "category": "technique",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "calm",
      "tags": [
        "instancing",
        "culling",
        "frustum",
        "CPU",
        "compaction",
        "plants",
        "batches",
        "uploads",
        "performance"
      ],
      "useCases": [
        "draw only the visible plants in a resident landscape",
        "compact several instance attributes without losing row identity",
        "avoid buffer uploads when the visible set is unchanged",
        "skip entire off-screen instance batches without compute dispatches"
      ],
      "interaction": "Toggle culling to compare submitted plants · drag to pause the camera · Next viewpoint works with reduced motion",
      "kits": [],
      "pairsWith": [
        {
          "id": "heightfield-chunks",
          "why": "Keep spatial batches near the same resident terrain chunks"
        },
        {
          "id": "auto-instancer",
          "why": "An alternative for converting individual scene objects into batches; use disjoint buffer ownership"
        },
        {
          "id": "compile-without-stalls",
          "why": "Prepare batches that may be entirely hidden at startup before their first appearance"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "6,400 plants in 25 batches",
          "low": "2,500 plants in 25 batches"
        },
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "intel xe-2lpg",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Microsoft Edge 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 4.391,
          "cpuMs": 1.025,
          "cpuP95Ms": 1.315,
          "badge": "heavy",
          "drawCalls": 66,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Microsoft Edge 157, Chromium 157 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 228 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 2.064,
          "cpuMs": 0.46,
          "cpuP95Ms": 1.86,
          "badge": "heavy",
          "drawCalls": 62,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 206 ms."
        }
      ],
      "signatures": [
        {
          "file": "instance-batch.ts",
          "declarations": "import type { InstancedBufferAttribute } from 'three';\nimport { type CullSet } from './plant-cull';\nexport type InstanceRow = {\n    source: Float32Array;\n    attribute: InstancedBufferAttribute;\n};\nexport declare class InstanceCullBatch {\n    readonly set: CullSet;\n    readonly indices: Uint32Array;\n    count: number;\n    uploadedFloats: number;\n    constructor(set: CullSet, rows: readonly InstanceRow[]);\n    invalidate(): void;\n    update(planes: Float32Array | null, margin?: number): boolean;\n}"
        },
        {
          "file": "plant-cull.ts",
          "declarations": "import { Vector3, type Camera } from 'three';\nexport type CullSet = {\n    count: number;\n    cx: Float32Array;\n    cy: Float32Array;\n    cz: Float32Array;\n    r: Float32Array;\n    bounds?: {\n        x: number;\n        y: number;\n        z: number;\n        r: number;\n    };\n};\nexport declare function cullBounds(set: CullSet): {\n    x: number;\n    y: number;\n    z: number;\n    r: number;\n};\nexport { viewPlanes } from './view';\nexport declare function visibleIndices(planes: Float32Array, set: CullSet, margin: number, out: Uint32Array): number;\nexport declare function sphereInView(planes: Float32Array, x: number, y: number, z: number, radius: number, margin: number): boolean;\nexport declare function viewChanged(last: {\n    position: Vector3;\n    zoom: number;\n    projection?: readonly number[];\n    quaternion: {\n        x: number;\n        y: number;\n        z: number;\n        w: number;\n    };\n} | null, camera: Camera & {\n    zoom?: number;\n}, move?: number, zoomShare?: number, turn?: number): boolean;\nexport declare function viewNow(camera: Camera & {\n    zoom?: number;\n}): {\n    projection: number[];\n    position: Vector3;\n    zoom: number;\n    quaternion: {\n        x: number;\n        y: number;\n        z: number;\n        w: number;\n    };\n};"
        }
      ],
      "pitfalls": [
        "CullSet sphere centres/radii and extracted planes are world-space",
        "Keep immutable source-order arrays separate from all destination attributes",
        "Call invalidate() after source rows, sphere positions/radii or set.count change",
        "InstanceCullBatch accepts dedicated non-interleaved Float32 InstancedBufferAttributes with…",
        "Apply count and visibility yourself",
        "Disable built-in mesh frustum culling or maintain a conservative bound over every possible…",
        "Do not use a main-camera selection for shadows, reflections or a second camera",
        "viewPlanes updates the camera and its parents",
        "A batch sphere shortcut is useful for spatially coherent groups",
        "The CPU approach avoids per-group dispatch overhead and empty indirect draws",
        "The demo has 10,000 plants at high, 6,400 at medium and 2,500 at low, all in 25 batches"
      ],
      "card": "entries/instance-cull.json"
    },
    {
      "id": "intent-bar",
      "aliases": [],
      "name": "Intent bar: sentences into actions",
      "summary": "Type what you want in plain words (“move the budget check to after the analyst is back”, “book 45 minutes with the designer next week, not Friday”) and a small local grammar, with no model and no network, turns it into an action. It shows what it understood before it acts: the typed words take the colour of the part they became, each part is a chip you can correct from a menu or take out, a missing part is a chip that asks, and one line says what will happen. It knows things (meetings and the like, with “the next”, “the April” or a date to pick one), people and groups, durations, times, hours, windows (“next week”, “in Q3”, “week 20”, “the week after”, “before the kickoff”, “after the analyst is back”) and exclusions (“not Monday or Friday”). It suggests whole sentences and the next words as you type, inline in grey for Tab. Keyboard first, a WAI-ARIA combobox, and each change said once.",
      "category": "ui",
      "role": "interaction",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "natural language",
        "command bar",
        "intent",
        "grammar",
        "parser",
        "dates",
        "relative dates",
        "time windows",
        "durations",
        "autocomplete",
        "inline completion",
        "suggestions",
        "chips",
        "correction",
        "combobox",
        "listbox",
        "menu",
        "live region",
        "accessibility",
        "keyboard",
        "scheduling",
        "planner",
        "no model",
        "offline",
        "pure",
        "tested",
        "dom",
        "css",
        "no dependencies"
      ],
      "useCases": [
        "a planner, calendar or booking tool you can tell what to do in one sentence",
        "a command bar that takes arguments in words, not forms (“assign the bug to the editor before Friday”)",
        "quick add for tasks and events with dates in plain words",
        "search filters typed as a sentence (“invoices from the analyst in Q3, not drafts”)",
        "showing a parse back as chips the person can correct before anything happens",
        "offline or private apps where sending typed text to a model is not an option"
      ],
      "interaction": "Type in the bar, or Type an example · Tab takes the grey words, ↓ the suggestions, Enter runs · click a chip to correct it · click a meeting to start a sentence",
      "kits": [],
      "pairsWith": [
        {
          "id": "command-palette",
          "why": "Commands by name beside sentences"
        },
        {
          "id": "meeting-scheduler",
          "why": "Book slots from a typed request"
        },
        {
          "id": "labelled-undo",
          "why": "Undo what a sentence did, by name"
        }
      ],
      "variants": [],
      "version": "1.1.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": null,
          "cpuMs": 0.285,
          "cpuP95Ms": 1.95,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.28,
            "p99Ms": 18.045,
            "low1Fps": 54.9
          },
          "notes": "Measured typing: from the first frame the demo types the example sentences one letter every other frame into the real field (input events), so every frame parses the sentence, ranks the suggestions (each one parsed too), recolours the words, redraws the chips and works out the preview on the planner; at the end of each sentence it runs it (the planner redraws, with a move animated) and starts the next. Idle, nothing runs."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.412,
          "cpuP95Ms": 2.34,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 99 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.27,
          "cpuP95Ms": 2.28,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 410 ms."
        }
      ],
      "signatures": [
        {
          "file": "days.ts",
          "declarations": "export type Day = number;\nexport declare const dayOf: (year: number, month: number, date: number) => Day;\nexport declare function ymd(day: Day): {\n    y: number;\n    m: number;\n    d: number;\n};\nexport declare const weekday: (day: Day) => number;\nexport declare const mondayOf: (day: Day) => Day;\nexport declare const monthStart: (year: number, month: number) => Day;\nexport declare const monthEnd: (year: number, month: number) => Day;\nexport declare function isoWeek(day: Day): number;\nexport declare function isoWeekStart(year: number, week: number): Day;\nexport declare const quarterDays: (year: number, q: number) => [\n    Day,\n    Day\n];\nexport declare function fmtDay(day: Day, o?: {\n    locale?: string;\n    year?: boolean;\n    long?: boolean;\n    weekday?: boolean;\n}): string;\nexport declare function fmtRange(from: Day, to: Day, locale?: string): string;\nexport declare const monthName: (month: number, locale?: string) => string;\nexport declare const fmtTime: (minutes: number) => string;\nexport declare function fmtLength(minutes: number): string;"
        },
        {
          "file": "grammar.ts",
          "declarations": "import { type Ranges } from './rank';\nimport { type Day } from './days';\nexport type { Day } from './days';\nexport type Span = [\n    number,\n    number\n];\nexport type SlotName = 'thing' | 'people' | 'window' | 'not' | 'hours' | 'time' | 'duration' | 'title';\nexport type Named = {\n    id: string;\n    name: string;\n    aliases?: string[];\n    phrase?: string;\n};\nexport type Thing = Named & {\n    day?: Day;\n    start?: number;\n};\nexport type Group = Named & {\n    members: string[];\n};\nexport type Vocab = {\n    things: readonly Thing[];\n    people: readonly Named[];\n    groups?: readonly Group[];\n};\nexport type Window = {\n    from: Day;\n    to: Day;\n    label: string;\n    kind: 'day' | 'days' | 'week' | 'month' | 'quarter' | 'back' | 'relative';\n    person?: string;\n    what?: string;\n    thing?: string;\n};\nexport type Hours = {\n    from: number;\n    to: number;\n    label: string;\n};\nexport type Slots = {\n    thing?: Thing;\n    people: string[];\n    groups: string[];\n    window?: Window;\n    not: number[];\n    hours?: Hours;\n    time?: number;\n    duration?: number;\n    title?: string;\n};\nexport type ChipKind = 'do' | 'thing' | 'person' | 'group' | 'window' | 'not' | 'hours' | 'time' | 'duration' | 'title';\nexport type Chip = {\n    kind: ChipKind;\n    slot: SlotName | 'do';\n    key: string;\n    value: string;\n    span: Span | null;\n    id?: string;\n    missing?: boolean;\n    removable: boolean;\n};\nexport type Mark = {\n    span: Span;\n    kind: ChipKind | 'unknown';\n    chip: number;\n    conflict?: boolean;\n};\nexport type Parse = {\n    text: string;\n    ok: boolean;\n    intent: IntentDef | null;\n    slots: Slots;\n    chips: Chip[];\n    marks: Mark[];\n    missing: Array<SlotName | 'do'>;\n    error: string;\n    say: string;\n};\nexport type SlotSpec = {\n    ask?: string;\n    lead?: string;\n    label?: string;\n};\nexport type Words = {\n    person(id: string): string;\n    people(slots: Slots): string;\n    day(day: Day, o?: {\n        year?: boolean;\n        long?: boolean;\n    }): string;\n    time(minutes: number): string;\n    length(minutes: number): string;\n    list(items: string[], join?: string): string;\n};\nexport type IntentDef = {\n    id: string;\n    label: string;\n    verbs: string[];\n    slots: Partial<Record<SlotName, SlotSpec>>;\n    needs?: Array<SlotName | SlotName[]>;\n    say?(slots: Slots, words: Words): string;\n};\nexport type GrammarOptions = {\n    intents: IntentDef[];\n    vocab(): Vocab;\n    today(): Day;\n    backDay?(person: string, from: Day): {\n        day: Day;\n        what: string;\n    } | null;\n    examples?: string[];\n    locale?: string;\n    day?: {\n        start: number;\n        lunch: [\n            number,\n            number\n        ];\n        end: number;\n    };\n};\nexport type Alternative = {\n    label: string;\n    text: string;\n    remove?: boolean;\n};\nexport type Suggestion = {\n    text: string;\n    kind: 'next' | 'complete' | 'example';\n    parse: Parse;\n    hit?: {\n        at: number;\n        ranges: Ranges;\n    };\n};\nexport type Grammar = {\n    parse(text: string): Parse;\n    suggest(text: string, limit?: number): Suggestion[];\n    alternatives(parse: Parse, chip: number): Alternative[];\n    phrases(slot: SlotName | 'do', intent?: IntentDef | null): string[];\n    readonly options: GrammarOptions;\n};\nexport declare const MAX_SUGGEST = 300;\nexport declare const phraseOf: (n: Named) => string;\nexport declare function tidy(text: string): string;\nexport declare const replaceSpan: (text: string, [a, b]: Span, phrase: string) => string;\nexport declare function removeSpan(text: string, [a, b]: Span, joined?: boolean): string;\nexport declare function createGrammar(options: GrammarOptions): Grammar;"
        },
        {
          "file": "intent-bar.ts",
          "declarations": "import type { Grammar, Parse } from './grammar';\nexport type IntentBarMessages = {\n    label: string;\n    placeholder: string;\n    go: string;\n    chips: string;\n    suggestions: string;\n    keepTyping: string;\n    hint: string;\n    count(n: number): string;\n};\nexport type Shown = {\n    ok: boolean;\n    say: string;\n    error: string;\n};\nexport type IntentBarOptions = {\n    grammar: Grammar;\n    run(parse: Parse): string | void | Promise<string | void>;\n    preview?(parse: Parse): {\n        say?: string;\n        error?: string;\n    } | void;\n    onChange?(parse: Parse, shown: Shown): void;\n    highlights?: boolean;\n    ghost?: boolean;\n    suggestions?: boolean;\n    clearOnRun?: boolean;\n    announceDelay?: number;\n    reducedMotion?: boolean;\n    messages?: Partial<IntentBarMessages>;\n};\nexport type IntentBar = {\n    readonly el: HTMLElement;\n    readonly input: HTMLInputElement;\n    readonly parse: Parse;\n    readonly shown: Shown;\n    setText(text: string, o?: {\n        focus?: boolean;\n        announce?: boolean;\n    }): void;\n    submit(): Promise<void>;\n    refresh(): void;\n    focus(): void;\n    set(o: Partial<Pick<IntentBarOptions, 'highlights' | 'ghost' | 'suggestions' | 'reducedMotion'>>): void;\n    dispose(): void;\n};\nexport declare function createIntentBar(host: HTMLElement, options: IntentBarOptions): IntentBar;"
        }
      ],
      "pitfalls": [
        "The grammar is English and small on purpose",
        "Return the same vocabulary object from vocab() until it changes",
        "Spans index the typed text exactly because the folding",
        "Dates are whole calendar days (days.ts), not instants",
        "“In March” said in April means this March (it ended under two months ago)",
        "“May” is also a verb: the month is taken only after a preposition (“in May”), with a modifier",
        "preview() runs on every keystroke while the sentence is whole",
        "Import intent-bar.base.css before intent-bar.css (or your own look)",
        "A whole word typed is kept",
        "Enter runs the sentence only when it is whole and preview() found no error"
      ],
      "card": "entries/intent-bar.json"
    },
    {
      "id": "jelly-marks",
      "aliases": [],
      "name": "Jelly marks",
      "summary": "Refracting gelatine boxes laid on a page’s own elements. Mark a day’s session, a chart’s bar or a cell’s fill with an attribute, and a jelly springs to its box: new ones drop in, moved ones slide across, pressed ones sink and spread, a clash trembles for a moment, and each casts a coloured shadow with a caustic in it. The cells under them become trays sunk into the paper. The element rides on its jelly’s top face, so its text stays in the page, selectable and in reading order. Colours come from CSS custom properties, so the page’s tokens paint them; without WebGPU the same springs drive CSS blobs.",
      "category": "ui",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "jelly",
        "gelatine",
        "refraction",
        "caustics",
        "springs",
        "squash and stretch",
        "calendar",
        "month view",
        "charts",
        "drag and drop",
        "raw webgpu",
        "wgsl",
        "dom + gpu",
        "shift lens",
        "design tokens",
        "reduced motion",
        "seeded",
        "keyboard",
        "no dependencies"
      ],
      "useCases": [
        "calendars and planners whose bookings feel like things you can pick up",
        "bar, column and stacked charts whose marks answer the hand",
        "showing conflicts by motion as well as words: a clash trembles when it appears or is touched, then rests",
        "kanban boards and trays of items moved between cells",
        "playful dashboards that stay plain DOM underneath"
      ],
      "interaction": "Drag a session to another day · press one to squash it · focus one and press Enter, then the arrows, to carry it",
      "kits": [
        {
          "kit": "dashboard",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "meeting-scheduler",
          "why": "Bookings in a month view as jelly"
        },
        {
          "id": "quiet-charts",
          "why": "Crisp charts beside the jelly ones"
        },
        {
          "id": "ui-sounds",
          "why": "A soft wobble sound as they land"
        }
      ],
      "variants": [],
      "version": "1.1.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "motion",
          "in": "module",
          "values": {
            "strict": "calm",
            "refined": "auto",
            "playful": "full"
          },
          "note": "calm: changes land at once and nothing trembles"
        },
        {
          "name": "liveliness",
          "in": "module",
          "values": {
            "strict": 25,
            "refined": 60,
            "playful": 90
          },
          "note": "0 to 100 (or calm, lively, playful): the bounce, the wobble and how long a tremble rings; every mark still comes to rest"
        },
        {
          "name": "parallax",
          "in": "module",
          "values": {
            "strict": false,
            "refined": false,
            "playful": true
          }
        },
        {
          "name": "refraction",
          "in": "module",
          "values": {
            "strict": 8,
            "refined": 18,
            "playful": 30
          },
          "note": "px the gelatine bends what is behind it (default 18)"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.282,
          "cpuMs": 0.485,
          "cpuP95Ms": 0.89,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the demo running itself from its first frame: every 0.8 s it shakes every mark, moves a session a day along and back (its jelly slides in the month and its brick between the weekday wells), or presses one, while the clashing sessions tremble throughout. The marks are driven from the demo’s update(), so CPU time is the springs, the reads of the moved cells and the riding labels, and GPU time the two passes (floor with trays, shadows and caustics, then the refracting marks at 4× multisampling), from their timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 2.228,
          "cpuMs": 0.452,
          "cpuP95Ms": 0.865,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.69,
            "p99Ms": 18.07,
            "low1Fps": 52
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 148 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 6.815,
          "cpuMs": 0.92,
          "cpuP95Ms": 1.32,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 736 ms."
        }
      ],
      "signatures": [
        {
          "file": "jelly-marks.ts",
          "declarations": "import { type Liveliness } from './jelly-core';\nimport { type RGB } from './jelly-gpu';\nexport type JellyRenderer = 'auto' | 'webgpu' | 'dom';\nexport type JellyMotion = 'auto' | 'full' | 'calm';\nexport type JellyMarksOptions = {\n    host: HTMLElement;\n    renderer?: JellyRenderer;\n    motion?: JellyMotion;\n    liveliness?: Liveliness;\n    trembleFor?: number;\n    ink?: boolean;\n    loop?: boolean;\n    observe?: boolean;\n    ride?: boolean;\n    touch?: boolean;\n    parallax?: boolean;\n    depth?: number;\n    refraction?: number;\n    seed?: number;\n    device?: GPUDevice;\n    dprCap?: number;\n    detail?: number;\n};\nexport type JellyMarks = {\n    readonly mode: 'webgpu' | 'dom';\n    readonly count: number;\n    scan(options?: {\n        snap?: boolean;\n    }): void;\n    press(id: string, on: boolean): void;\n    poke(id: string, k?: number): void;\n    pokeAll(k?: number): void;\n    flash(id: string, k?: number): void;\n    hold(id: string, clientX: number, clientY: number): void;\n    release(id: string): void;\n    burst(clientX: number, clientY: number, colors?: string[], n?: number): void;\n    pick(clientX: number, clientY: number): string | null;\n    where(id: string): {\n        x: number;\n        y: number;\n        w: number;\n        h: number;\n    } | null;\n    pointer(nx: number, ny: number): void;\n    onFrame(fn: (marks: JellyMarks) => void): () => void;\n    frame(dt: number): boolean;\n    refresh(): void;\n    set(options: {\n        motion?: JellyMotion;\n        liveliness?: Liveliness;\n        trembleFor?: number;\n        refraction?: number;\n        depth?: number;\n        parallax?: boolean;\n    }): void;\n    use(renderer: JellyRenderer): Promise<'webgpu' | 'dom'>;\n    gpuTime(): number | null;\n    dispose(): void;\n};\nexport declare const luminance: ([r, g, b]: RGB) => number;\nexport declare const contrast: (a: RGB, b: RGB) => number;\nexport declare function inkFor(color: RGB): {\n    ink: RGB;\n    halo: RGB;\n    ratio: number;\n};\nexport declare function createJellyMarks(options: JellyMarksOptions): Promise<JellyMarks>;"
        }
      ],
      "pitfalls": [
        "Give marked elements and trays no background of their own",
        "The host becomes a stacking context",
        "Marks are read from the DOM",
        "Each marked element rides on its jelly",
        "Ids are data-jm-mark’s value and must be unique in the host",
        "The first scan and every resize land at once",
        "Trembling is information here (a clash), and reduced motion stills it",
        "A label on a jelly needs its own colour",
        "Colours can be any CSS colour",
        "Without WebGPU, or with the renderer set to dom",
        "A drag is yours to write (the module has hold and release)"
      ],
      "card": "entries/jelly-marks.json"
    },
    {
      "id": "keyboard-shortcuts",
      "aliases": [],
      "name": "Keyboard shortcuts: registry, help, rebinding",
      "summary": "One registry for every shortcut in an app: chords like mod+k and sequences like G then I, scopes for panels and dialogs, guards for typing (in a field, or over one empty item the app types into), IME composition, held keys and open dialogs, conflicts found, ⌘ or Ctrl shown as each platform writes it, aria-keyshortcuts kept true, a filterable help on ?, and rebinding that records a new combo, shows what it clashes with and saves. Restyle it through its parts. Plain DOM, no dependencies.",
      "category": "ui",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "keyboard",
        "shortcuts",
        "hotkeys",
        "key sequences",
        "type to edit",
        "rebinding",
        "help overlay",
        "aria-keyshortcuts",
        "accessibility",
        "IME",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "editors and other tools people use all day",
        "G-then-letter navigation between pages",
        "lists you move through with J and K",
        "a ? help that never goes out of date",
        "letting users change keys that clash with their own setup",
        "typing a name over a new, empty card, cell or row without firing letter shortcuts"
      ],
      "interaction": "Click a note, then ? for the help · J, K and S in the list · type over the empty note · G then I · Ctrl B while typing · rebind under Customise",
      "kits": [
        {
          "kit": "foundations",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "command-palette",
          "why": "Every shortcut also a command"
        },
        {
          "id": "menu-skins",
          "why": "Menus that show the keys"
        },
        {
          "id": "reach-test",
          "why": "Proves every function has a key or a command"
        }
      ],
      "variants": [],
      "version": "1.0.2",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 1.92,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured pressing a key every six frames on the note list (J, K, S and the G-then sequences, which move the selection, star notes and switch folders), and opening the help with a filter and closing it every hundred frames. Nothing runs between key presses."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 2.315,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 104 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 3.2,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 45 ms."
        }
      ],
      "signatures": [
        {
          "file": "help.ts",
          "declarations": "import { type ListOptions } from './list';\nimport type { Shortcuts } from './shortcuts';\nexport type HelpOptions = Pick<ListOptions, 'scopes' | 'include' | 'messages' | 'editable' | 'renderRow'> & {\n    container?: HTMLElement;\n    title?: string;\n    intro?: string;\n    filterLabel?: string;\n    closeLabel?: string;\n    scope?: string;\n    onClose?: () => void;\n    animate?: (layer: HTMLElement, phase: 'open' | 'close') => Promise<unknown> | void;\n};\nexport type Help = {\n    element: HTMLElement;\n    filter(text: string): void;\n    close(): void;\n};\nexport declare function openHelp(shortcuts: Shortcuts, options?: HelpOptions): Help;"
        },
        {
          "file": "list.ts",
          "declarations": "import type { Command } from './registry';\nimport type { Shortcuts } from './shortcuts';\nexport type ListMessages = {\n    change: string;\n    reset: string;\n    resetAll: string;\n    listening: string;\n    none: string;\n    noMatch: (query: string) => string;\n    count: (n: number) => string;\n    or: string;\n    then: string;\n    custom: string;\n    recordHint: (label: string) => string;\n    cancelled: string;\n    now: (label: string, keys: string) => string;\n    backTo: (label: string, keys: string) => string;\n    allReset: string;\n    reserved: (keys: string) => string;\n    clash: (keys: string, others: string) => string;\n    waits: (keys: string, others: string) => string;\n    take: (label: string) => string;\n    keepBoth: string;\n    cancel: string;\n    clashing: (others: string) => string;\n    notSaved: string;\n};\nexport declare const LIST_MESSAGES: ListMessages;\nexport type ListOptions = {\n    editable?: boolean;\n    scopes?: Record<string, string>;\n    include?: (command: Command) => boolean;\n    announce?: (text: string) => void;\n    renderRow?: (row: HTMLLIElement, command: Command) => void;\n    messages?: Partial<ListMessages>;\n};\nexport declare function liveRegion(host: HTMLElement): {\n    say: (text: string) => void;\n    remove: () => void;\n};\nexport declare function keycaps(keys: string, mac: boolean, then?: string): HTMLElement;\nexport declare function createShortcutList(container: HTMLElement, shortcuts: Shortcuts, options?: ListOptions): {\n    element: HTMLDivElement;\n    filter(text: string): number;\n    refresh: () => number;\n    dispose(): void;\n};"
        },
        {
          "file": "shortcuts.ts",
          "declarations": "import { type Command } from './registry';\nexport type { Command } from './registry';\nexport { startsText } from './keys';\nexport type KeyStorage = {\n    read(): string | null;\n    write(value: string): void;\n};\nexport declare const localStorageAt: (key: string) => KeyStorage;\nexport declare function memoryStorage(initial?: string | null): KeyStorage;\nexport type IgnoredReason = 'typing' | 'modal' | 'repeat' | 'disabled';\nexport type ShortcutsOptions = {\n    commands: Command[];\n    target?: EventTarget;\n    mac?: boolean;\n    storage?: KeyStorage | null;\n    sequenceTimeout?: number;\n    ignoreInFields?: boolean;\n    typesInto?: (event: KeyboardEvent) => boolean;\n    stopPropagation?: boolean;\n    isModalOpen?: () => boolean;\n    onRun?: (command: Command, keys: string, event: KeyboardEvent) => void;\n    onIgnored?: (keys: string, reason: IgnoredReason, command: Command | null) => void;\n    onPending?: (keys: string | null) => void;\n};\nexport type Shortcuts = ReturnType<typeof createShortcuts>;\nexport declare function isTypingTarget(el: EventTarget | null): boolean;\nexport declare function createShortcuts(options: ShortcutsOptions): {\n    registry: {\n        mac: boolean;\n        commands: () => Command[];\n        get: (id: string) => Command | undefined;\n        keysFor: (id: string) => string[];\n        defaultsFor: (id: string) => string[];\n        isCustom: (id: string) => boolean;\n        hasCustom: () => boolean;\n        setKeys: (id: string, keys: string[]) => void;\n        release: (id: string, keys: string) => void;\n        reset: (id: string) => undefined;\n        resetAll: () => void;\n        conflicts: () => import(\"./registry\").Conflict[];\n        clashes: (id: string, keys: string) => Array<{\n            id: string;\n            keys: string;\n            kind: import(\"./registry\").Conflict[\"kind\"];\n        }>;\n        toJSON: () => Record<string, string[]>;\n        load: (raw: unknown) => number;\n    };\n    mac: boolean;\n    settings: {\n        sequenceTimeout: number;\n        ignoreInFields: boolean;\n        enabled: boolean;\n    };\n    readonly saveFailed: boolean;\n    readonly pending: string;\n    typesInto(event: KeyboardEvent): boolean;\n    scope(name: string, element: Element): () => undefined;\n    modal(name: string): () => void;\n    describe(element: Element, id: string): () => void;\n    keysFor: (id: string) => string[];\n    text(id: string, or?: string): string;\n    setKeys(id: string, keys: string[]): void;\n    assign(id: string, keys: string): void;\n    reset(id: string): void;\n    resetAll(): void;\n    clashes: (id: string, keys: string) => {\n        id: string;\n        keys: string;\n        kind: import(\"./registry\").Conflict[\"kind\"];\n    }[];\n    isReserved: (keys: string) => boolean;\n    record(opts?: {\n        onProgress?: (keys: string) => void;\n        signal?: AbortSignal;\n    }): Promise<string | null>;\n    subscribe(fn: () => void): () => undefined;\n    dispose(): void;\n};"
        }
      ],
      "pitfalls": [
        "Import shortcuts.base.css, then shortcuts.css (or your own look instead)",
        "Bind once, on window, for the whole app (the default)",
        "Some keys never reach the page",
        "Single letters (J, S, G then I) must not run while someone types",
        "Typing over a selection with no field focused",
        "Single-letter shortcuts also clash with screen readers’ browse-mode letters and speech input",
        "aria-keyshortcuts has no way to say a sequence (its spaces mean “or”)",
        "Shift is ignored for symbols (?, /, [) because layouts disagree on which need it: “shift+?” and…",
        "event.key follows the user’s layout, so mod+z is the key marked Z on AZERTY too",
        "Saved bindings are untrusted input"
      ],
      "card": "entries/keyboard-shortcuts.json"
    },
    {
      "id": "keyframe-timeline",
      "aliases": [],
      "name": "Scrubbable keyframe timeline",
      "summary": "Scenes as plain data (\"move these channels to these values over this long, with this ease\"), any moment worked out on demand with no state, and the editor that goes with it: a lane per channel, bars you drag and stretch with snapping, a playhead that never re-renders, and a play, pause, loop and scrub transport. Effects too: families with named phases (sparks:gather, sparks:burst) placed as clips on the same lanes, each phase a number from 0 to 1 worked out from the time, and each effect drawn from those numbers alone, so scrubbing backwards or jumping shows exactly what playing showed.",
      "category": "ui",
      "role": "interaction",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "animation",
        "keyframes",
        "timeline",
        "easing",
        "scrubbing",
        "editor",
        "drag and drop",
        "snapping",
        "effects",
        "effect phases",
        "family:phase",
        "progress",
        "deterministic",
        "no dependencies"
      ],
      "useCases": [
        "intros, splashes and title sequences",
        "product tours and onboarding",
        "motion and video editors",
        "scripted UI choreography",
        "cut-scenes and game sequences",
        "data stories",
        "effects in a live show that must look the same after a jump back"
      ],
      "interaction": "Drag a bar, or its end to time it (Alt: no snap) · Space plays · arrows nudge",
      "kits": [],
      "pairsWith": [
        {
          "id": "camera-director",
          "why": "Camera shots on the timeline"
        },
        {
          "id": "cue-console",
          "why": "Run scenes from a cue list"
        },
        {
          "id": "labelled-undo",
          "why": "Undo edits to keys by name"
        }
      ],
      "variants": [],
      "version": "1.0.2",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0.08,
          "cpuP95Ms": 0.125,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured playing in a loop: each frame works out all nine channels from the scenes (no state kept between frames), the cards three times over for their stagger, writes the scene’s styles and moves the two playheads and the live values. Nothing is laid out again."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.235,
          "cpuP95Ms": 0.37,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 55 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.16,
          "cpuP95Ms": 0.42,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 46 ms."
        }
      ],
      "signatures": [
        {
          "file": "clock.ts",
          "declarations": "export declare class Clock {\n    time: number;\n    rate: number;\n    duration: number;\n    constructor(duration: number, { playing, loop, time }?: {\n        playing?: boolean;\n        loop?: boolean;\n        time?: number;\n    });\n    get playing(): boolean;\n    get loop(): boolean;\n    set loop(value: boolean);\n    advance(dt: number): number;\n    play(): void;\n    pause(): void;\n    toggle(): void;\n    seek(t: number): void;\n    restart(): void;\n    onChange(fn: () => void): () => void;\n}"
        },
        {
          "file": "effects.ts",
          "declarations": "import { type Ease, type Scene } from './timeline';\nexport type EffectInstance<P extends string = string> = {\n    update(progress: Readonly<Record<P, number>>, time: number): void;\n    dispose?(): void;\n};\nexport type EffectFamily<P extends string = string, Ctx = unknown> = {\n    id: string;\n    label?: string;\n    phases: readonly P[];\n    create(ctx: Ctx): EffectInstance<P>;\n    idle?: boolean;\n};\nexport type EffectClip = {\n    ref: string;\n    at: number;\n    over: number;\n    name?: string;\n    ease?: Ease;\n};\nexport declare function parseEffectRef(ref: string, families?: readonly EffectFamily<string, never>[]): {\n    family: string;\n    phase: string;\n} | null;\nexport declare function effectChannels(families: readonly EffectFamily<string, never>[]): string[];\nexport declare function clipScenes(clips: readonly EffectClip[]): Scene[];\nexport declare const isClipScene: (s: Scene) => boolean;\nexport declare function phaseProgress(clips: readonly EffectClip[], ref: string, t: number): number;\nexport declare const resting: (progress: Readonly<Record<string, number>>) => boolean;\nexport type EffectRuntime = {\n    readonly instances: ReadonlyMap<string, EffectInstance>;\n    update(valueOf: (ref: string) => number, time: number): boolean;\n    dispose(): void;\n};\nexport declare function effectRuntime<Ctx>(families: readonly EffectFamily<string, Ctx>[], ctx: Ctx): EffectRuntime;"
        },
        {
          "file": "lanes.ts",
          "declarations": "import { type Move, type TimelineDef } from './timeline';\nexport type ChannelInfo = {\n    label: string;\n    hint?: string;\n    format?: (v: number) => string;\n};\nexport type LaneEditorOptions<C extends string> = {\n    def: TimelineDef<C>;\n    time: () => number;\n    onSeek: (t: number) => void;\n    onChange?: (def: TimelineDef<C>) => void;\n    info?: Partial<Record<C, ChannelInfo>>;\n    snap?: number;\n    valueAt?: (channel: C, t: number) => number;\n    palette?: string[];\n    loop?: boolean;\n    renderBar?(bar: HTMLElement, move: Move<C>, first: boolean): void;\n};\nexport type LaneEditor<C extends string> = {\n    readonly element: HTMLElement;\n    readonly options: LaneEditorOptions<C>;\n    readonly def: TimelineDef<C>;\n    set(def: TimelineDef<C>): void;\n    frame(): void;\n    dispose(): void;\n};\nexport declare function laneEditor<C extends string>(host: HTMLElement, options: LaneEditorOptions<C>): LaneEditor<C>;"
        },
        {
          "file": "timeline.ts",
          "declarations": "export type Ease = 'linear' | 'in' | 'out' | 'inOut' | 'outBack' | 'step';\nexport type Target = number | {\n    to: number;\n    over?: number;\n    ease?: Ease;\n    delay?: number;\n};\nexport type Scene<C extends string = string> = {\n    at: number;\n    name: string;\n    over?: number;\n    ease?: Ease;\n    to: Partial<Record<C, Target>>;\n};\nexport type TimelineDef<C extends string = string> = {\n    channels: readonly C[];\n    initial?: Partial<Record<C, number>>;\n    scenes: Scene<C>[];\n    duration: number;\n};\nexport type Move<C extends string = string> = {\n    scene: number;\n    channel: C;\n    start: number;\n    over: number;\n    to: number;\n    ease: Ease;\n    name: string;\n    own: boolean;\n};\nexport declare const DEFAULT_OVER = 0.6;\nexport declare const DEFAULT_EASE: Ease;\nexport declare function ease(kind: Ease, x: number): number;\nexport declare function movesOf<C extends string>(def: Pick<TimelineDef<C>, 'channels' | 'scenes'>): Move<C>[];\nexport type Timeline<C extends string = string> = {\n    channels: readonly C[];\n    at(t: number): Float32Array;\n    value(channel: C, t: number): number;\n};\nexport declare function timeline<C extends string>(def: Pick<TimelineDef<C>, 'channels' | 'scenes' | 'initial'>): Timeline<C>;\nexport declare function firstAbove<C extends string>(tl: Timeline<C>, channel: C, until: number, above?: number): number;\nexport declare function integral<C extends string>(tl: Timeline<C>, channel: C, until: number): Float32Array;\nexport declare function sumAt(sum: Float32Array, t: number): number;"
        },
        {
          "file": "transport.ts",
          "declarations": "import type { Clock } from './clock';\nexport type Mark = {\n    at: number;\n    name: string;\n};\nexport type TransportOptions = {\n    clock: Clock;\n    marks?: Mark[];\n    keys?: HTMLElement | null;\n    nudge?: number;\n    loop?: boolean;\n};\nexport type Transport = {\n    readonly element: HTMLElement;\n    setMarks(marks: Mark[]): void;\n    frame(): void;\n    dispose(): void;\n};\nexport declare function transport(host: HTMLElement, options: TransportOptions): Transport;"
        }
      ],
      "pitfalls": [
        "A move starts from where its channel is when it starts",
        "Two moves of one channel that overlap",
        "Dragging a bar moves its whole scene (every lane it touches)",
        "outBack overshoots past its target (by about 10%)",
        "The lane editor and transport read time() every frame but write only when it changed",
        "Space and the arrows are taken only inside the element you pass as `keys`",
        "Import timeline.base.css before timeline.css",
        "An effect draws from its phases’ progress alone",
        "A phase runs once on a timeline (0 before its clip, 1 after)",
        "Make every effect up front with effectRuntime (where a GPU renderer can warm it)"
      ],
      "card": "entries/keyframe-timeline.json"
    },
    {
      "id": "kpi-tiles",
      "aliases": [],
      "name": "KPI tiles",
      "summary": "A row of figure tiles that lines up: each a label, a value at the one size every value in the row shares, a detail line with the change (arrow, figure, period) or a note, and a sparkline. Values are written the reader’s way (plain, compact, a percentage, money); a percentage’s change is in points; whether a change is good follows which way is better, and a worse change is told by a shape as well as a colour. Each tile is one plain sentence to a screen reader. A figure that updates, loads or goes missing changes its words, never its box.",
      "category": "data",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "kpi",
        "stat tile",
        "metric",
        "dashboard",
        "figure",
        "delta",
        "trend",
        "sparkline",
        "locale",
        "compact numbers",
        "currency",
        "percentage points",
        "accessibility",
        "live data",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "the top row of a dashboard",
        "a live board’s figures (sign-ups, wait times, counts left)",
        "a report’s headline numbers",
        "any row of figures people compare at a glance"
      ],
      "interaction": "Pause Ticking to inspect a reading · lose or reload the uptime feed",
      "kits": [
        {
          "kit": "dashboard",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "quiet-charts",
          "why": "The full charts under the row of figures"
        },
        {
          "id": "gauges-rings",
          "why": "A gauge for the one figure that needs a target"
        },
        {
          "id": "loading-states",
          "why": "The feed behind the figures, with its notes kept in place"
        },
        {
          "id": "chart-access",
          "why": "The same figures as a table and CSV"
        }
      ],
      "variants": [],
      "version": "1.1.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.7,
            "p99Ms": 18.105,
            "low1Fps": 54.8
          },
          "notes": "Measured with every figure ticking once a second (new values, changes, sentences and sparklines drawn again) in a row of five tiles."
        }
      ],
      "signatures": [
        {
          "file": "kpi-tiles.ts",
          "declarations": "import { type Kpi } from './kpi-model';\nexport type KpiRowOptions = {\n    locale?: string;\n    sparklines?: boolean;\n};\nexport type KpiRow = {\n    readonly element: HTMLElement;\n    update(tiles: readonly Kpi[]): void;\n    dispose(): void;\n};\nexport declare function kpiRow(host: HTMLElement, tiles: readonly Kpi[], o?: KpiRowOptions): KpiRow;"
        }
      ],
      "pitfalls": [
        "Give every value in the row one size and one line",
        "Say which way is better (`better: 'down'` for errors, churn, wait times)",
        "A percentage’s change is in points (2.1% to 2.4% is “up 0.3 pts”)",
        "Don’t tell good and worse by colour alone",
        "The change has one width (`--kpi-delta-w`, 9ch, about “▼ 12.6%” or “▲ 0.3 pts”) so its period…",
        "Keep the detail line even when a figure has no change to show",
        "Pass `period` as the words after the change (“on last week”, “since yesterday”)",
        "Update in place (`update(tiles)`, matched by id)"
      ],
      "card": "entries/kpi-tiles.json"
    },
    {
      "id": "labelled-undo",
      "aliases": [],
      "name": "Undo that says what it undoes",
      "summary": "An undo/redo history whose steps carry a few words, so the buttons say “Undo Move ‘Dune’”; one drag or one typing session is one step, and so is a drag of a slider or a colour picker, which previews live and writes once on release; a rename that rewrites the formulas reading the old name, in the same step; a history list you can jump through; and “unsaved” as an identity check. Plain app state, no dependencies.",
      "category": "systems",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "undo",
        "redo",
        "history",
        "gestures",
        "drafts",
        "keyboard shortcuts",
        "sliders",
        "form controls",
        "rename",
        "formulas",
        "references",
        "inspector",
        "useSyncExternalStore",
        "no dependencies"
      ],
      "useCases": [
        "editors and design tools",
        "boards and canvases",
        "forms with many fields",
        "settings panels",
        "level and content editors",
        "property inspectors with sliders and colour pickers",
        "renaming a value that formulas read"
      ],
      "interaction": "Drag, recolour, resize, add and delete tiles · rename Dune: Neon’s size formula follows, one step · Ctrl Z / Ctrl Shift Z · click the history to jump",
      "kits": [
        {
          "kit": "foundations",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "arrange-in-place",
          "why": "Named undo for every move and resize"
        },
        {
          "id": "property-panel",
          "why": "One step per slider drag"
        },
        {
          "id": "keyboard-shortcuts",
          "why": "Ctrl Z and Ctrl Shift Z from one registry"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.80",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-03",
          "gpuMs": null,
          "cpuMs": 0.19,
          "cpuP95Ms": 1.06,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured exercising itself: every frame commits an edit (a move or a recolour) and re-renders the board, the bar and the history; every other frame undoes or redoes, and every 40 frames it jumps back through the history."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.425,
          "cpuP95Ms": 2.495,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 44 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.78,
          "cpuP95Ms": 1.8,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 51 ms."
        }
      ],
      "signatures": [
        {
          "file": "edit-stack.ts",
          "declarations": "export type EditSnapshot<T> = {\n    value: T;\n    clean: T;\n    dirty: boolean;\n    undoLabel: string | null;\n    redoLabel: string | null;\n    past: string[];\n    future: string[];\n    holding: boolean;\n    version: number;\n};\nexport type EditStackOptions<T> = {\n    equals?: (a: T, b: T) => boolean;\n    limit?: number;\n    mergeMs?: number;\n};\nexport type Hold = {\n    release(label?: string): void;\n    cancel(): void;\n};\nexport declare class EditStack<T> {\n    limit: number;\n    mergeMs: number;\n    constructor(initial: T, options?: EditStackOptions<T>);\n    subscribe: (listener: () => void) => () => boolean;\n    getSnapshot: () => EditSnapshot<T>;\n    get value(): T;\n    get dirty(): boolean;\n    get canUndo(): boolean;\n    get canRedo(): boolean;\n    preview(next: T): void;\n    cancelPreview(): void;\n    hold(label: string): Hold;\n    stopMerging(): void;\n    commit(label: string, next: T | ((current: T) => T)): void;\n    undo(): void;\n    redo(): void;\n    jump(steps: number): void;\n    markClean(value?: T): void;\n    reload(value: T, force?: boolean): boolean;\n}\nexport declare class EditStacks<T> {\n    constructor(make: (id: string) => T, options?: EditStackOptions<T>);\n    for(id: string): EditStack<T>;\n    anyDirty(): boolean;\n    dirtyIds(): string[];\n    reloadAll(value: (id: string) => T | undefined): void;\n}"
        },
        {
          "file": "field-edits.ts",
          "declarations": "import type { EditStack } from './edit-stack';\nexport type FieldIO<V> = {\n    get(): V;\n    preview(value: V): void;\n    commit(value: V, from: V): void;\n    restore?(from: V): void;\n    equals?(a: V, b: V): boolean;\n};\nexport type FieldGesture<V> = {\n    input(value: V): void;\n    end(): void;\n    cancel(): void;\n    drop(): void;\n    readonly active: boolean;\n    readonly from: V | undefined;\n};\nexport declare function createFieldGesture<V>(io: FieldIO<V>): FieldGesture<V>;\ntype Control = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;\nexport type FieldOptions<V> = FieldIO<V> & {\n    parse?(control: Control): V | undefined;\n    format?(value: V): string;\n    oneStep?: boolean;\n};\nexport type BoundField<V> = {\n    sync(): void;\n    gesture: FieldGesture<V>;\n    dispose(): void;\n};\nexport declare function bindField<V>(control: Control, options: FieldOptions<V>): BoundField<V>;\nexport type StackFieldOptions<T, V> = {\n    read(state: T): V;\n    write(state: T, value: V): T;\n    label(value: V, from: V): string;\n    parse?: FieldOptions<V>['parse'];\n    format?: FieldOptions<V>['format'];\n    equals?: FieldOptions<V>['equals'];\n    oneStep?: boolean;\n    preview?(value: V): void;\n};\nexport declare function stackField<T, V>(control: Control, stack: EditStack<T>, o: StackFieldOptions<T, V>): BoundField<V>;\nexport {};"
        },
        {
          "file": "history.ts",
          "declarations": "export type HistorySnapshot = {\n    undoLabel: string | null;\n    redoLabel: string | null;\n    past: string[];\n    future: string[];\n    canUndo: boolean;\n    canRedo: boolean;\n    holding: boolean;\n    version: number;\n};\nexport type HistoryOptions = {\n    limit?: number;\n    mergeMs?: number;\n};\nexport type HistoryHold = {\n    release(label?: string): void;\n    cancel(): void;\n};\nexport declare function createHistory(options?: HistoryOptions): {\n    record: (label: string, undo: () => void, redo: () => void) => void;\n    run(label: string, redo: () => void, undo: () => void): void;\n    hold(label: string): HistoryHold;\n    undo(): void;\n    redo(): void;\n    jump(steps: number): void;\n    stopMerging(): void;\n    clear(): void;\n    undoLabel: () => string | null;\n    redoLabel: () => string | null;\n    canUndo: () => boolean;\n    canRedo: () => boolean;\n    limit: number;\n    mergeMs: number;\n    subscribe(listener: () => void): () => undefined;\n    getSnapshot: () => HistorySnapshot;\n};\nexport type History = ReturnType<typeof createHistory>;"
        },
        {
          "file": "rename-refs.ts",
          "declarations": "export declare const nameKey: (s: string) => string;\nexport declare const bracket: (name: string) => string;\nexport declare function renameNamesIn(formula: string, renamed: readonly (readonly [\n    string,\n    string\n])[]): string;\nexport declare function namesIn(formula: string): string[];\nexport declare const reads: (formula: string, name: string) => boolean;\nexport type RenameOptions<T> = {\n    formulas?: readonly (keyof T & string)[];\n    isFormula?: (text: string) => boolean;\n};\nexport declare function followRename<T extends object>(items: readonly T[], from: string, to: string, o?: RenameOptions<T>): {\n    items: T[];\n    followed: number;\n};\nexport type RenameResult<T> = {\n    ok: true;\n    items: T[];\n    followed: number;\n    label: string;\n} | {\n    ok: false;\n    reason: 'empty' | 'missing' | 'taken';\n    message: string;\n};\nexport declare const renameLabel: (from: string, to: string, followed: number) => string;\nexport declare function renameWithRefs<T extends {\n    name: string;\n}>(items: readonly T[], from: string, to: string, o?: RenameOptions<T>): RenameResult<T>;"
        },
        {
          "file": "undo-keys.ts",
          "declarations": "export type UndoTarget = {\n    undo(): void;\n    redo(): void;\n};\nexport declare const undoKeys: () => \"⌘Z\" | \"Ctrl Z\";\nexport declare const redoKeys: () => \"⇧⌘Z\" | \"Ctrl Shift Z\";\nexport declare const undoTip: (verb: \"Undo\" | \"Redo\", words: string, keys: string) => string;\nexport declare function undoIntent(e: Pick<KeyboardEvent, 'key' | 'ctrlKey' | 'metaKey' | 'shiftKey' | 'altKey'>): 'undo' | 'redo' | null;\nexport declare function bindUndoKeys(target: HTMLElement | Document | Window, stack: UndoTarget, options?: {\n    inFields?: boolean;\n}): () => void;"
        }
      ],
      "pitfalls": [
        "Every edit must make a new object",
        "Keep selection, hover and scroll out of the stack",
        "Name a step when it ends, not when it starts",
        "A merge window joins same-label commits only",
        "Leave Ctrl Z in a text field to the field",
        "A slider fires `input` for every value it passes",
        "A field that previews through the stack re-renders everything that reads the state on every…",
        "Chrome doesn’t repaint `::-webkit-slider-runnable-track` when a custom property on the input…",
        "Rename and rewrite in one commit (or inside one hold)",
        "Refuse a new name another value already has (renameWithRefs does, any capitals and spaces)",
        "While a rename is typed in a hold, the formulas still name the old one",
        "renameNamesIn leaves words in quotes, a card’s name before a dot",
        "With `createHistory`, an undo function that records its own change would record the undo"
      ],
      "card": "entries/labelled-undo.json"
    },
    {
      "id": "lamp-lights",
      "aliases": [],
      "name": "Many lamps, few lights",
      "summary": "Hundreds of lamps lit for the price of eight lights. A fixed pool of real three.js lights (4 point, 4 spot) goes to the lamps nearest what matters, chosen again every quarter second: a lamp that stays keeps its light, a hand-over fades out and in, a margin stops two lamps trading a light back and forth, and the farthest fades toward the edge of its reach, so nothing pops. Every other lamp is faked in three instanced draws: a glow, a soft beam near the camera and a pool of light on the ground, and the pool dims as the real light fades in, so the hand-over is a crossfade. Windows light up through an instance attribute, each at its own point as night falls, and lamps warm up one by one.",
      "category": "technique",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "calm",
      "tags": [
        "lights",
        "light pool",
        "point light",
        "spot light",
        "street lamps",
        "night",
        "instancing",
        "instance attribute",
        "glow",
        "light beam",
        "light pool on the ground",
        "lit windows",
        "level of detail",
        "hysteresis",
        "crossfade",
        "dusk",
        "shader compile",
        "light count",
        "WebGPU limits",
        "three.js",
        "TSL",
        "no dependencies"
      ],
      "useCases": [
        "street lamps, wall lamps and bollards across a town or a game level at night",
        "a building or a city with thousands of lit windows",
        "floodlights and searchlights washing walls and landing on the ground",
        "architectural and product walk-throughs after dark",
        "keeping the light count fixed so shaders never rebuild mid-game",
        "dusk falling across a scene, lamps coming on one by one",
        "stadiums, car parks, harbours and yards lit by rows of masts"
      ],
      "interaction": "Drag to orbit · W A S D move · Q E turn · G glide · L rings the lamps with real lights",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "light-sheets",
          "why": "Lamps glowing in volumetric haze"
        },
        {
          "id": "heightfield-chunks",
          "why": "Lamps along streamed ground"
        },
        {
          "id": "road-network",
          "why": "Street lamps along the lanes"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "mixed",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 0.945,
          "cpuMs": 0.27,
          "cpuP95Ms": 0.405,
          "badge": "moderate",
          "drawCalls": 16,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured gliding by itself round its loop (down a street, rising over each open crossing, along the boulevard and through the square), the real lights handed between lamps as it goes, rings on. 236 lamps (posts, wall lamps, bollards, floods), 4 point and 4 spot lights, about 840 windows; every lamp a glow, every post a pool and a beam near the camera."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 6.423,
          "cpuMs": 0.95,
          "cpuP95Ms": 1.365,
          "badge": "heavy",
          "drawCalls": 16,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 454 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 3.15,
          "cpuMs": 0.4,
          "cpuP95Ms": 0.6,
          "badge": "heavy",
          "drawCalls": 16,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 986 ms."
        }
      ],
      "signatures": [
        {
          "file": "lamp-lights.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { type Flicker } from './choose';\ntype V3 = {\n    x: number;\n    y: number;\n    z: number;\n};\nexport interface LampSpec {\n    kind: 'point' | 'spot';\n    position: V3;\n    direction?: V3;\n    color?: THREE.ColorRepresentation;\n    intensity?: number;\n    range?: number;\n    angle?: number;\n    penumbra?: number;\n    size?: number;\n    flicker?: Flicker;\n    depth?: number;\n    rate?: number;\n    onAt?: number;\n    key?: string;\n}\nexport interface LampLightsOptions {\n    points?: number;\n    spots?: number;\n    interval?: number;\n    fade?: number;\n    hysteresis?: number;\n    pointNear?: number;\n    spotNear?: number;\n    groundAt?: (x: number, z: number) => number;\n    beamNear?: number;\n    maxBeams?: number;\n    poolAlone?: number;\n    poolWithLight?: number;\n    glow?: number;\n    beam?: number;\n    glowScale?: number;\n    warmUp?: number;\n    air?: number;\n    ringColor?: THREE.ColorRepresentation;\n}\nexport interface Lamp {\n    readonly index: number;\n    readonly kind: 'point' | 'spot';\n    readonly at: THREE.Vector3;\n    readonly direction: THREE.Vector3;\n    readonly color: THREE.Color;\n    intensity: number;\n    range: number;\n    angle: number;\n    penumbra: number;\n    size: number;\n    flicker: Flicker;\n    depth: number;\n    rate: number;\n    onAt: number;\n    disabled: boolean;\n    readonly ground: THREE.Vector3;\n    reach: number;\n    warm: number;\n    level: number;\n    readonly seed: number;\n}\nexport interface Held {\n    kind: 'point' | 'spot';\n    slot: number;\n    lamp: number;\n    next: number;\n    weight: number;\n    distance: number;\n}\nexport declare class LampLights {\n    readonly object3D: THREE.Group<THREE.Object3DEventMap>;\n    readonly lamps: Lamp[];\n    readonly points: THREE.PointLight[];\n    readonly spots: THREE.SpotLight[];\n    night: number;\n    steady: boolean;\n    interval: number;\n    hysteresis: number;\n    pointNear: number;\n    spotNear: number;\n    beamNear: number;\n    poolAlone: number;\n    poolWithLight: number;\n    warmUp: number;\n    debug: boolean;\n    constructor(specs: readonly LampSpec[], options?: LampLightsOptions);\n    get fade(): number;\n    set fade(value: number);\n    set air(value: number);\n    get glow(): number;\n    set glow(value: number);\n    get beam(): number;\n    set beam(value: number);\n    get handovers(): number;\n    resizePool(points: number, spots: number): void;\n    compile(renderer: THREE.WebGPURenderer, scene: THREE.Object3D, camera: THREE.Camera): Promise<void>;\n    setDisabled(index: number, disabled: boolean): void;\n    update(dt: number, focus: V3, camera?: THREE.Camera): boolean;\n    snap(): void;\n    held(): Held[];\n    litCount(): number;\n    dispose(): void;\n}\nexport {};"
        },
        {
          "file": "window-glow.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nexport interface WindowGlowOptions {\n    capacity: number;\n    glass?: THREE.ColorRepresentation;\n    roughness?: number;\n    metalness?: number;\n    warm?: THREE.ColorRepresentation;\n    cool?: THREE.ColorRepresentation;\n    strength?: number;\n    gradient?: boolean;\n}\nexport declare const WINDOW_ATTRIBUTE = \"windowLit\";\nexport declare class WindowGlow {\n    readonly material: THREE.MeshStandardNodeMaterial;\n    readonly attribute: THREE.InstancedBufferAttribute;\n    constructor(options: WindowGlowOptions);\n    get night(): number;\n    set night(value: number);\n    set strength(value: number);\n    attach(geometry: THREE.BufferGeometry): void;\n    set(index: number, brightness: number, warmth?: number, onAt?: number): void;\n    fill(count: number, share?: number, seed?: number, from?: number, to?: number): void;\n    dispose(): void;\n}"
        }
      ],
      "pitfalls": [
        "Make the real lights once and never add or remove one. three bakes the number of lights into…",
        "Each light in the pool costs in every lit pixel, even at intensity 0",
        "Not three r187’s DynamicLighting (three/addons/lighting/DynamicLighting.js)",
        "Call compile() once the object is in the scene, before the first frame",
        "Choose by what matters, not by the camera alone",
        "Keep the hold margin (hysteresis) above 0 when lamps stand in rows",
        "A hand-over fades out, then in, so the fade sets how fast the light follows a fast camera",
        "Match the faked pool to the real light by eye",
        "The glow, beams and pools are added on top (additive blending)",
        "Instance colours are set from the start (all black)",
        "Beams are drawn for spots within beamNear of the camera",
        "The window attribute travels with its instance"
      ],
      "card": "entries/lamp-lights.json"
    },
    {
      "id": "lan-remote",
      "aliases": [],
      "name": "LAN phone remote",
      "summary": "A phone on the same Wi-Fi steps a presentation, with no cloud and no app: scan a QR code, type a six-digit code, and Next and Back go to the presenting machine. Pairing locks after five wrong codes, tokens are compared in constant time, only local addresses and the app’s own origin get in, sessions start only on the presenting machine, commands expire after 2 s and count once, every queue is bounded, the phone’s buttons wait while the presenter isn’t answering, and a new code disconnects every phone. One hub for a Node server, a Vite plugin or an in-page rehearsal; a plain-DOM phone page and pairing panel.",
      "category": "systems",
      "role": "system",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "remote control",
        "presentation",
        "clicker",
        "pairing",
        "QR code",
        "one-time code",
        "lockout",
        "constant-time compare",
        "DNS rebinding",
        "same-origin",
        "local network",
        "LAN",
        "Wi-Fi",
        "polling",
        "deduplication",
        "expiry",
        "Node",
        "Vite plugin",
        "middleware",
        "live region",
        "accessibility",
        "keyboard",
        "touch",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "a phone as a clicker for slides or a show",
        "pairing a phone with an app on the LAN",
        "a local control page for a tool or kiosk",
        "speaker notes and a timer on a phone",
        "rehearsing a remote without a network",
        "a QR code for a local link"
      ],
      "interaction": "Scan the code on the phone, type the code, press Next · or try a wrong code, freeze the presenter, reset · nothing leaves your browser",
      "kits": [],
      "pairsWith": [
        {
          "id": "slide-show-player",
          "why": "Next and back from a phone"
        },
        {
          "id": "cue-console",
          "why": "Go and hold from the room"
        },
        {
          "id": "audience-vote",
          "why": "Phones in the same room voting"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the phone paired and pressing Next and Back about three times a second over the in-page network (no delay), the presenter publishing four times a second and applying each command, and the hub panel redrawn on each change. The slide’s sun and sky transitions run in CSS. At rest the two polling loops (the protocol itself) still run: a publish every 250 ms and a state read every 350 ms."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 0.01,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 105 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.02,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 143 ms."
        }
      ],
      "signatures": [
        {
          "file": "hub.ts",
          "declarations": "import { type Limits, type QueuedCommand, type Random } from './protocol';\nexport type HubRequest = {\n    method: string;\n    path: string;\n    remoteAddress: string;\n    host: string;\n    origin?: string;\n    fetchSite?: string;\n    authorization?: string;\n    body?: unknown;\n};\nexport type HubReply = {\n    status: number;\n    body: Record<string, unknown>;\n};\nexport type HubOptions = {\n    addresses?: () => string[];\n    lan?: () => boolean;\n    now?: () => number;\n    random?: Random;\n    limits?: Partial<Limits>;\n};\nexport type SessionView = {\n    id: string;\n    code: string;\n    remotes: number;\n    failures: number;\n    locked: number;\n    updated: number;\n    queue: QueuedCommand[];\n    expires: number;\n};\nexport type RemoteHub = {\n    handle(request: HubRequest): HubReply;\n    inspect(): SessionView[];\n    limits: Readonly<Limits>;\n    setLimits(limits: Partial<Limits>): void;\n    clear(): void;\n};\nexport declare function createRemoteHub(o?: HubOptions): RemoteHub;"
        },
        {
          "file": "loopback.ts",
          "declarations": "import type { RemoteHub } from './hub';\nimport type { RemoteCall, RemoteReply, RemoteTransport } from './protocol';\nexport type LoopbackDevice = {\n    remoteAddress: string;\n    host: string;\n    origin?: string;\n    fetchSite?: string;\n    latency?: number | (() => number);\n    onCall?: (call: RemoteCall, reply: RemoteReply, device: LoopbackDevice) => void;\n    online?: () => boolean;\n};\nexport declare function loopbackTransport(hub: RemoteHub, device: LoopbackDevice): RemoteTransport;"
        },
        {
          "file": "pairing-panel.ts",
          "declarations": "import type { PresenterLink } from './presenter-link';\nimport { type PairingSession } from './protocol';\nimport { type Ecc } from './qr';\nexport declare const PAIRING_LABELS: {\n    title: string;\n    scan: string;\n    meta: string;\n    peers: (n: number) => string;\n    address: string;\n    open: string;\n    reset: string;\n    starting: string;\n    noLan: string;\n    noAddress: string;\n    code: string;\n    qr: (url: string) => string;\n    saidPeers: (n: number, before: number) => string;\n    saidReset: string;\n};\nexport type PairingPanelOptions = {\n    labels?: Partial<typeof PAIRING_LABELS>;\n    url?: (session: PairingSession, address: string) => string;\n    onOpen?: (url: string, event: MouseEvent) => void;\n    ecc?: Ecc;\n};\nexport type PairingPanel = {\n    element: HTMLElement;\n    readonly url: string;\n    destroy(): void;\n};\nexport declare function mountPairingPanel(host: HTMLElement, link: PresenterLink, options?: PairingPanelOptions): PairingPanel;"
        },
        {
          "file": "presenter-link.ts",
          "declarations": "import { type PairingSession, type QueuedCommand, type RemoteAction, type RemoteState, type RemoteTransport } from './protocol';\nexport type PresenterLinkOptions = {\n    transport: RemoteTransport;\n    state: () => RemoteState;\n    onCommand: (action: RemoteAction, command: QueuedCommand) => void;\n    onExpired?: (command: QueuedCommand) => void;\n    interval?: number;\n    now?: () => number;\n};\nexport type PresenterLinkStatus = 'idle' | 'starting' | 'live' | 'error' | 'ended';\nexport type PresenterLinkSnapshot = {\n    status: PresenterLinkStatus;\n    session?: PairingSession;\n    peers: number;\n    error: string;\n};\nexport type PresenterLink = {\n    readonly snapshot: PresenterLinkSnapshot;\n    start(): Promise<void>;\n    publish(): void;\n    reset(): Promise<void>;\n    stop(): void;\n    subscribe(fn: (s: PresenterLinkSnapshot) => void): () => void;\n};\nexport declare function createPresenterLink(o: PresenterLinkOptions): PresenterLink;"
        },
        {
          "file": "protocol.ts",
          "declarations": "export type RemoteAction = 'next' | 'back';\nexport type RemoteState = {\n    title: string;\n    current: string;\n    next: string;\n    notes: string;\n    index: number;\n    count: number;\n    elapsed: number;\n    timerRunning: boolean;\n    busy: boolean;\n    paused: boolean;\n    complete: boolean;\n};\nexport type PairingSession = {\n    id: string;\n    owner: string;\n    code: string;\n    addresses: string[];\n    port: string;\n    lan: boolean;\n};\nexport type QueuedCommand = {\n    id: number;\n    action: RemoteAction;\n    expires: number;\n};\nexport declare const LIMITS: {\n    sessions: number;\n    remotes: number;\n    failures: number;\n    lockoutMs: number;\n    sessionMs: number;\n    idleMs: number;\n    commandTtlMs: number;\n    staleMs: number;\n    queue: number;\n    requests: number;\n    requestIdMs: number;\n    bodyBytes: number;\n};\nexport type Limits = typeof LIMITS;\nexport declare const PREFIX = \"/__presenter/\";\nexport type Random = (bytes: Uint8Array) => Uint8Array;\nexport declare const webRandom: Random;\nexport declare function localAddress(address: string): boolean;\nexport declare const loopbackAddress: (address: string) => boolean;\nexport declare function sameSecret(given: string, secret: string): boolean;\nexport declare function randomToken(random?: Random): string;\nexport declare function pairingCode(random?: Random): string;\nexport declare function requestId(random?: Random): string;\nexport declare const REQUEST_ID: RegExp;\nexport declare function remoteKey(key: string, options?: {\n    repeat?: boolean;\n    editable?: boolean;\n    modifier?: boolean;\n}): RemoteAction | undefined;\nexport declare function formatElapsed(seconds: number): string;\nexport declare function remoteUrl(host: string, port: string, id: string, path?: string): string;\nexport declare function lanAddressesFrom(interfaces: Record<string, ReadonlyArray<{\n    family: string | number;\n    internal: boolean;\n    address: string;\n}> | undefined>): string[];\nexport type RemoteCall = {\n    method: 'GET' | 'POST';\n    path: string;\n    token?: string;\n    body?: unknown;\n};\nexport type RemoteReply = {\n    status: number;\n    data: Record<string, unknown>;\n};\nexport type RemoteTransport = (call: RemoteCall) => Promise<RemoteReply>;\nexport declare class RemoteError extends Error {\n    readonly status: number;\n    readonly data: Record<string, unknown>;\n    constructor(message: string, status: number, data?: Record<string, unknown>);\n}\nexport declare function remoteRequest<T>(transport: RemoteTransport, path: string, token?: string, body?: unknown): Promise<T>;\nexport declare function fetchTransport(o?: {\n    base?: string;\n    timeout?: number;\n    fetch?: typeof fetch;\n}): RemoteTransport;"
        },
        {
          "file": "remote-client.ts",
          "declarations": "import { type RemoteAction, type RemoteState, type RemoteTransport } from './protocol';\nexport type RemoteClientOptions = {\n    transport: RemoteTransport;\n    id: string;\n    storage?: Pick<Storage, 'getItem' | 'setItem' | 'removeItem'> | null;\n    interval?: number;\n    staleAfter?: number;\n    cooldown?: number;\n    now?: () => number;\n};\nexport type RemotePhase = 'pair' | 'waiting' | 'live' | 'ended';\nexport type RemoteSnapshot = {\n    phase: RemotePhase;\n    state?: RemoteState;\n    fresh: boolean;\n    sending: boolean;\n    pairing: boolean;\n    error: string;\n    reason: string;\n    left?: number;\n    lockedUntil: number;\n};\nexport type RemoteClient = {\n    readonly snapshot: RemoteSnapshot;\n    pair(code: string): Promise<boolean>;\n    command(action: RemoteAction): Promise<boolean>;\n    can(action: RemoteAction): boolean;\n    disconnect(): void;\n    subscribe(fn: (s: RemoteSnapshot) => void): () => void;\n    destroy(): void;\n};\nexport declare function createRemoteClient(o: RemoteClientOptions): RemoteClient;"
        },
        {
          "file": "remote-page.ts",
          "declarations": "import type { RemoteClient } from './remote-client';\nexport declare const REMOTE_LABELS: {\n    eyebrow: string;\n    connected: string;\n    reconnecting: string;\n    unpaired: string;\n    ended: string;\n    pairTitle: string;\n    pairText: string;\n    codeLabel: string;\n    pair: string;\n    pairing: string;\n    left: (n: number) => string;\n    locked: (s: number) => string;\n    waiting: string;\n    onScreen: (i: number, n: number) => string;\n    upNext: string;\n    end: string;\n    notes: string;\n    noNotes: string;\n    paused: string;\n    back: string;\n    next: string;\n    stale: string;\n    again: string;\n    revoked: string;\n    endedTitle: string;\n    endedText: string;\n    saidStep: (i: number, n: number, title: string) => string;\n    saidPaired: string;\n    saidLost: string;\n    saidBack: string;\n};\nexport type RemotePageOptions = {\n    labels?: Partial<typeof REMOTE_LABELS>;\n    keys?: EventTarget | null;\n    formatTime?: (seconds: number) => string;\n};\nexport type RemotePage = {\n    element: HTMLElement;\n    destroy(): void;\n};\nexport declare function mountRemotePage(host: HTMLElement, client: RemoteClient, options?: RemotePageOptions): RemotePage;"
        },
        {
          "file": "server.ts",
          "declarations": "import { type HubOptions, type RemoteHub } from './hub';\nexport type NodeRequest = AsyncIterable<Uint8Array | string> & {\n    url?: string;\n    method?: string;\n    headers: Record<string, string | string[] | undefined>;\n    socket: {\n        remoteAddress?: string;\n    };\n};\nexport type NodeResponse = {\n    headersSent: boolean;\n    writeHead(status: number, headers: Record<string, string>): unknown;\n    end(body?: string): unknown;\n};\nexport type Middleware = ((req: NodeRequest, res: NodeResponse, next: () => void) => Promise<void>) & {\n    hub: RemoteHub;\n};\nexport type MiddlewareOptions = HubOptions & {\n    prefix?: string;\n    hub?: RemoteHub;\n};\nexport declare function presenterMiddleware(o?: MiddlewareOptions): Middleware;"
        },
        {
          "file": "vite-plugin.ts",
          "declarations": "import { type HubOptions } from './hub';\nimport { type NodeRequest, type NodeResponse } from './server';\nexport type ViteServerLike = {\n    middlewares: {\n        use(fn: (req: NodeRequest, res: NodeResponse, next: () => void) => void): unknown;\n    };\n    httpServer: {\n        address(): unknown;\n    } | null;\n    resolvedUrls?: {\n        network: string[];\n    } | null;\n};\nexport type LanRemotePluginOptions = HubOptions & {\n    prefix?: string;\n};\nexport declare function lanRemote(o?: LanRemotePluginOptions): {\n    name: string;\n    configureServer: (server: ViteServerLike) => void;\n    configurePreviewServer: (server: ViteServerLike) => void;\n};"
        }
      ],
      "pitfalls": [
        "This is plain HTTP on a trusted local network",
        "Phones only reach the server when it listens beyond loopback",
        "The Host header must be localhost, 127.0.0.1, [::1] or one of this machine’s LAN addresses",
        "Sessions start only from loopback (127.0.0.1 or ::1)",
        "Everything lives in the server’s memory",
        "The state you publish goes to every paired phone four times a second",
        "Commands expire after 2 s and the presenter drops any that arrive late",
        "A phone keeps its token in sessionStorage",
        "Web Crypto (globalThis.crypto) is needed for the codes and tokens"
      ],
      "card": "entries/lan-remote.json"
    },
    {
      "id": "laser-cutting",
      "aliases": [],
      "name": "Laser cutting steel plate",
      "summary": "A CNC laser cutting any shape out of thick steel: a jump-flooded distance field of the outlines on the GPU, the kerf glowing in black-body colours and leaving temper colours as it cools, sparks thrown from the cut, and each cut piece falling through the bed as a rigid body. One clock drives it all, so it scrubs.",
      "category": "simulation",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "jump flooding",
        "distance field",
        "blackbody",
        "temper colours",
        "sparks",
        "rigid body",
        "ray tracing",
        "wgsl",
        "raw webgpu",
        "webgl2 fallback"
      ],
      "useCases": [
        "title and logo reveals",
        "product and manufacturing visualisation",
        "loading and splash screens",
        "game workshops and crafting",
        "teaching heat and the jump flood"
      ],
      "interaction": "Drag or use the arrow keys to look around · type a Word to cut it · scrub with Progress",
      "kits": [],
      "pairsWith": [
        {
          "id": "print-slicer",
          "why": "The same shapes printed instead of cut"
        },
        {
          "id": "glass-engraving",
          "why": "The laser engraving glass"
        },
        {
          "id": "heat-haze-shockwaves",
          "why": "Air shimmering over the hot kerf"
        }
      ],
      "variants": [],
      "version": "1.1.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "mixed",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 5.972,
          "cpuMs": 0.2,
          "cpuP95Ms": 0.33,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured cutting the default word over and over from the tray, at the defaults: 128k spark slots stepped and drawn, the shop ray-traced at half size with extra rays on the cut’s edges, a quarter-size bloom; timed with its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 3.211,
          "cpuMs": 0.44,
          "cpuP95Ms": 0.645,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 6650 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 7.853,
          "cpuMs": 0.8,
          "cpuP95Ms": 1.04,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 247 ms."
        }
      ],
      "signatures": [
        {
          "file": "cut.ts",
          "declarations": "import { type BodyShape, type Quat, type Slat, type Track, type V3 } from './physics';\nimport { type Field, type Mask } from './shape';\nexport type ShapeMask = Mask & {\n    capTop: number;\n    baseline: number;\n};\nexport type CutOptions = {\n    cap?: number;\n    thick?: number;\n    feed?: number;\n    seed?: number;\n    slats?: number;\n    fromAbove?: boolean;\n};\nexport declare const WORLD: {\n    readonly top: 0.95;\n    readonly kerf: 0.0026;\n    readonly slatH: 0.11;\n    readonly slatHalf: 0.0025;\n    readonly lead: 0.007;\n    readonly crater: 0.0028;\n};\nexport declare const PIECES_MAX = 40;\nexport declare const SLATS_MAX = 8;\nexport type Piece = {\n    loop: Float32Array;\n    cum: Float32Array;\n    length: number;\n    times: Float32Array;\n    dur: number;\n    shape: BodyShape;\n    com: {\n        x: number;\n        z: number;\n    };\n    area: number;\n    box: [\n        number,\n        number,\n        number,\n        number\n    ];\n    pierce: {\n        x: number;\n        z: number;\n    };\n    start: {\n        x: number;\n        z: number;\n    };\n    letter: number;\n};\nexport type Seg = {\n    m0: number;\n    m1: number;\n    kind: 'approach' | 'rapid' | 'pierce' | 'lead' | 'cut';\n    piece: number;\n    a: {\n        x: number;\n        z: number;\n    };\n    b: {\n        x: number;\n        z: number;\n    };\n};\nexport type CutPlan = {\n    thick: number;\n    top: number;\n    bottom: number;\n    kerf: number;\n    plate: {\n        x0: number;\n        x1: number;\n        z0: number;\n        z1: number;\n    };\n    pieces: Piece[];\n    bridges: {\n        a: {\n            x: number;\n            z: number;\n        };\n        b: {\n            x: number;\n            z: number;\n        };\n    }[];\n    slats: Slat[];\n    segs: Seg[];\n    job: number;\n    end: number;\n    marks: {\n        pierce0: number;\n        pierce1: number;\n        cut0: number;\n        cut1: number;\n    }[];\n    tracks: (Track | null)[];\n    planned: (Track | null)[];\n    centre: V3;\n    first: V3;\n    seed: number;\n    mpp: number;\n    flip: 1 | -1;\n    mid: {\n        x: number;\n        y: number;\n    };\n    field: Field;\n};\nexport declare function piecesOf(mask: ShapeMask, cap: number, flip?: 1 | -1): {\n    pieces: Omit<Piece, 'times' | 'dur'>[];\n    bridges: CutPlan['bridges'];\n    mpp: number;\n    mid: {\n        x: number;\n        y: number;\n    };\n    field: Field;\n};\nexport type Head = {\n    x: number;\n    z: number;\n    kind: Seg['kind'] | 'done';\n    piece: number;\n    s: number;\n    dir: number;\n    lift: number;\n    pierce: number;\n};\nexport declare function headAt(plan: Pick<CutPlan, 'segs' | 'pieces' | 'end'>, t: number): Head;\nexport declare const timeAt: (plan: Pick<CutPlan, \"job\">, progress: number) => number;\nexport declare function progressOf(plan: Pick<CutPlan, 'marks' | 'pieces' | 'end'>, i: number, t: number): number;\nexport declare function cutTable(plan: Pick<CutPlan, 'marks' | 'pieces' | 'end'>, i: number, n?: number): Float32Array<ArrayBuffer>;\nexport declare const RATE = 240;\nexport declare const GRID_FLOATS = 8;\nexport declare function emitterGrid(plan: CutPlan, until?: number): Float32Array<ArrayBuffer>;\nexport declare function planCut(mask: ShapeMask, { cap, thick: thickMm, feed, seed, slats: spacingM, fromAbove }?: CutOptions): CutPlan;\nexport declare function dropNow(plan: CutPlan, t: number): void;\nexport declare function resetCut(plan: CutPlan): void;\nexport declare function settledAt(plan: Pick<CutPlan, 'tracks' | 'end'>): number;\nexport declare function pieceAt(plan: Pick<CutPlan, 'tracks' | 'pieces' | 'bottom' | 'thick'>, i: number, t: number): {\n    p: V3;\n    q: Quat;\n    moving: boolean;\n};\nexport declare function lightsAt(plan: CutPlan, t: number): {\n    spot: [\n        number,\n        number,\n        number,\n        number\n    ];\n    temp: number;\n    trail: [\n        number,\n        number,\n        number,\n        number\n    ][];\n    head: Head;\n};"
        },
        {
          "file": "jump-flood.ts",
          "declarations": "export type Coverage = {\n    f: Float32Array | Uint8Array;\n    w: number;\n    h: number;\n};\nexport type DistanceField = {\n    texture: GPUTexture;\n    w: number;\n    h: number;\n    px: number;\n    destroy(): void;\n};\nexport type JumpFloodOptions = {\n    texels?: number;\n    loops?: Float32Array[];\n};\nexport declare const JUMP_FLOOD_WGSL = \"\\nstruct FU { size: vec4f, mask: vec4f };\\n@group(0) @binding(0) var<uniform> fu: FU;\\n@group(0) @binding(1) var<storage, read> seeds: array<vec4f>;\\n@group(0) @binding(2) var src: texture_2d<f32>;\\n@group(0) @binding(3) var dst: texture_storage_2d<rgba32float, write>;\\n@group(0) @binding(4) var inkTex: texture_2d<f32>;\\n@group(0) @binding(5) var fieldOut: texture_storage_2d<rgba16float, write>;\\n@group(0) @binding(6) var<uniform> jump: vec4f;\\n\\n@compute @workgroup_size(8, 8) fn cs_clear(@builtin(global_invocation_id) id: vec3u) {\\n  if (f32(id.x) >= fu.size.x || f32(id.y) >= fu.size.y) { return; }\\n  textureStore(dst, id.xy, vec4f(-1e6, -1e6, 0.0, -1.0));\\n}\\n\\n@compute @workgroup_size(64) fn cs_splat(@builtin(global_invocation_id) id: vec3u) {\\n  if (id.x >= u32(fu.size.z)) { return; }\\n  let s = seeds[id.x];\\n  let p = vec2i(floor(s.xy));\\n  if (p.x < 0 || p.y < 0 || f32(p.x) >= fu.size.x || f32(p.y) >= fu.size.y) { return; }\\n  textureStore(dst, vec2u(p), s);\\n}\\n\\n@compute @workgroup_size(8, 8) fn cs_jump(@builtin(global_invocation_id) id: vec3u) {\\n  if (f32(id.x) >= fu.size.x || f32(id.y) >= fu.size.y) { return; }\\n  let p = vec2f(id.xy) + 0.5;\\n  let k = i32(jump.x);\\n  var best = textureLoad(src, vec2i(id.xy), 0);\\n  var bd = select(1e12, dot(best.xy - p, best.xy - p), best.w >= 0.0);\\n  for (var dy = -1; dy <= 1; dy++) {\\n    for (var dx = -1; dx <= 1; dx++) {\\n      let q = vec2i(id.xy) + vec2i(dx, dy) * k;\\n      if (q.x < 0 || q.y < 0 || f32(q.x) >= fu.size.x || f32(q.y) >= fu.size.y) { continue; }\\n      let c = textureLoad(src, q, 0);\\n      if (c.w < 0.0) { continue; }\\n      let d = dot(c.xy - p, c.xy - p);\\n      if (d < bd) { bd = d; best = c; }\\n    }\\n  }\\n  textureStore(dst, id.xy, best);\\n}\\n\\n@compute @workgroup_size(8, 8) fn cs_field(@builtin(global_invocation_id) id: vec3u) {\\n  if (f32(id.x) >= fu.size.x || f32(id.y) >= fu.size.y) { return; }\\n  let p = vec2f(id.xy) + 0.5;\\n  let c = textureLoad(src, vec2i(id.xy), 0);\\n  let px = fu.mask.z;\\n  let d = select(1e4, length(c.xy - p) * px, c.w >= 0.0);\\n  // Inside the mask or not: its coverage where this texel's point falls in it (bilinear).\\n  let dims = vec2f(textureDimensions(inkTex));\\n  let mi = clamp(p * px - 0.5, vec2f(0.0), dims - 1.001);\\n  let i0 = vec2i(floor(mi)); let fr = mi - floor(mi);\\n  let a = textureLoad(inkTex, i0, 0).r; let b = textureLoad(inkTex, i0 + vec2i(1, 0), 0).r;\\n  let cc = textureLoad(inkTex, i0 + vec2i(0, 1), 0).r; let dd = textureLoad(inkTex, i0 + vec2i(1, 1), 0).r;\\n  let ink = mix(mix(a, b, fr.x), mix(cc, dd, fr.x), fr.y);\\n  textureStore(fieldOut, id.xy, vec4f(select(d, -d, ink > 0.5), c.z, max(c.w, 0.0), 1.0));\\n}\\n\";\nexport declare function loopsOf(mask: Coverage): Float32Array[];\nexport declare function jumpFlood(device: GPUDevice, mask: Coverage, { texels, loops }?: JumpFloodOptions): Promise<DistanceField>;"
        },
        {
          "file": "laser-cut-gl.ts",
          "declarations": "import { type CutPlan } from './cut';\nimport { type LaserCut, type Quality } from './laser-cut';\nexport type LaserCutGl = Omit<LaserCut, 'device'> & {\n    readonly gl: WebGL2RenderingContext;\n};\nexport declare function createLaserCutGl(canvas: HTMLCanvasElement, plan: CutPlan, { quality, sparks }?: {\n    quality?: Quality | undefined;\n    sparks?: number | undefined;\n}): Promise<LaserCutGl | null>;"
        },
        {
          "file": "laser-cut.ts",
          "declarations": "import { type CutPlan } from './cut';\nimport { type V3 } from './physics';\nexport type Quality = 'low' | 'medium' | 'high';\nexport declare const QUALITY: Record<Quality, {\n    scale: number;\n    field: number;\n    edges: boolean;\n}>;\nexport type Camera = {\n    eye: V3;\n    target: V3;\n    fov: number;\n};\nexport type Look = {\n    heat?: number;\n    lights?: number;\n    exposure?: number;\n    bloom?: number;\n};\nexport type LaserCut = {\n    readonly device: GPUDevice;\n    setPlan(plan: CutPlan): Promise<void>;\n    refresh(): void;\n    draw(t: number, camera: Camera, look?: Look): boolean;\n    setSparks(count: number): void;\n    setQuality(quality: Quality): Promise<void>;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare const BACK = 2.7;\nexport declare const MAX_STEPS = 420;\nexport declare const TAIL = 3;\nexport declare const COLOURS: {\n    shop: number[];\n    steel: number[];\n    hot: number[];\n    work: number[];\n    pilot: number[];\n};\nexport declare function viewProjection(eye: V3, right: V3, up: V3, fwd: V3, fovY: number, aspect: number): Float32Array;\nexport declare function basis(cam: Camera): {\n    fwd: V3;\n    right: V3;\n    up: V3;\n};\nexport declare function stepUniforms(p: CutPlan, sparkCount: number, gridSteps: number): Float32Array<ArrayBuffer>;\nexport type FrameSize = {\n    w: number;\n    h: number;\n    dpr: number;\n    edges: boolean;\n    fieldW: number;\n    fieldH: number;\n};\nexport declare function packFrame(frame: Float32Array, p: CutPlan, t: number, cam: Camera, look: Look, size: FrameSize): void;\nexport declare function createLaserCut(canvas: HTMLCanvasElement, plan: CutPlan, { quality, sparks }?: {\n    quality?: Quality | undefined;\n    sparks?: number | undefined;\n}): Promise<LaserCut | null>;\nexport declare function describe(plan: CutPlan, t: number): string;"
        },
        {
          "file": "text-mask.ts",
          "declarations": "export type TextMask = {\n    data: Uint8Array;\n    w: number;\n    h: number;\n    capTop: number;\n    baseline: number;\n};\nexport type TextMaskOptions = {\n    px?: number;\n    weight?: number | string;\n    family?: string;\n    pad?: number;\n};\nexport declare function textMask(text: string, { px, weight, family, pad }?: TextMaskOptions): TextMask;"
        }
      ],
      "pitfalls": [
        "Plan once, draw often: planCut() traces the outlines and simulates every slug’s fall up front",
        "The field is in the mask’s px",
        "Without bridges a counter (the hole in an “e”) would fall out with its letter. bridgesOf()…",
        "The sparks step from 2.7 s before the moment after a jump (a scrub or a replay)",
        "rgba16float holds how far along an outline a texel is to about 1/2000",
        "Draw only while something changes",
        "Without WebGPU, start createLaserCutGl on the same canvas",
        "A canvas gives one kind of context",
        "The twin’s ray tracer takes seconds to compile the first time on Windows",
        "draw() returns false when it skipped a frame (the last one still on the GPU)"
      ],
      "card": "entries/laser-cutting.json"
    },
    {
      "id": "light-sheets",
      "aliases": [],
      "name": "Light sheets in the air",
      "summary": "Volumetric air after the scene, for three.js WebGPU in TSL: a 40-step ray march through haze that thins with height and drifts in a tiling 3D noise, lit by spots with Henyey–Greenstein forward scattering, glows, and thin sheets of light worked out exactly where each ray crosses them, so a laser blade a few centimetres thick stays razor sharp at any step count. The march runs at half size and is spread back by depth; its jitter is fixed per pixel and averaged away, so nothing shimmers without TAA. Any number of each light, set at construction; a dark one costs one branch; every setting is a uniform, so nothing rebuilds while it runs. A helper paints the sheets’ line on your surfaces.",
      "category": "post",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "balanced",
      "tags": [
        "volumetric",
        "fog",
        "haze",
        "god rays",
        "light shafts",
        "laser",
        "light sheet",
        "ray marching",
        "tsl",
        "post-processing",
        "half resolution",
        "depth-aware upsampling",
        "henyey–greenstein",
        "interleaved sampling",
        "draw on demand",
        "no dependencies"
      ],
      "useCases": [
        "a laser scanner sweeping through haze",
        "stage light and spotlight shafts",
        "sun through a high window",
        "lamps, portals and flares lighting the air",
        "product reveals and title shots",
        "museum, hall and showroom moods"
      ],
      "interaction": "Drag to orbit · switch the lights in the stage · Sweep for one quick pass",
      "kits": [
        {
          "kit": "product-presentation",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "volumetric-mist",
          "why": "Mist the sheets light up"
        },
        {
          "id": "lamp-lights",
          "why": "Many lamps glowing in the haze"
        },
        {
          "id": "post-stack",
          "why": "Bloom and a grade over the air"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "The air marched in 32 steps at two fifths of the canvas.",
          "low": "The air marched in 24 steps at a third of the canvas."
        },
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 1.235,
          "cpuMs": 0.46,
          "cpuP95Ms": 0.815,
          "badge": "moderate",
          "drawCalls": 20,
          "computeDispatches": 0,
          "frames": null,
          "notes": "The hall at 1920×1080: 40 steps a pixel with the level sheet scanning, the spot and the glow lit and the haze drifting, then bloom; drawn every frame."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 10.617,
          "cpuMs": 1.555,
          "cpuP95Ms": 2.625,
          "badge": "heavy",
          "drawCalls": 20,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 872 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 8.692,
          "cpuMs": 0.24,
          "cpuP95Ms": 0.34,
          "badge": "heavy",
          "drawCalls": 20,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 1418 ms."
        }
      ],
      "signatures": [
        {
          "file": "air-maths.ts",
          "declarations": "export type Vec3 = {\n    x: number;\n    y: number;\n    z: number;\n};\nexport declare function coneCosines(halfAngle: number, softness?: number): {\n    outer: number;\n    inner: number;\n};\nexport declare function henyeyGreenstein(cosTheta: number, g: number): number;\nexport declare function forwardPeak(g: number): number;\nexport declare function slabPath(thickness: number, cosToNormal: number, grazing?: number): number;\nexport declare function transmittance(haze: number, distance: number): number;\nexport declare function densityAt(haze: number, heightFall: number, floorY: number, y: number): number;\nexport declare function normalise(v: Vec3): Vec3;\nexport declare function sheetAxes(normal: Vec3): {\n    normal: Vec3;\n    u: Vec3;\n    v: Vec3;\n};\nexport declare function rayPlane(o: Vec3, d: Vec3, p: Vec3, n: Vec3): number | null;"
        },
        {
          "file": "compile-turn.ts",
          "declarations": "export declare function inTurn<T>(renderer: object, job: () => Promise<T>): Promise<T>;"
        },
        {
          "file": "light-sheets.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node, TextureNode, UniformNode } from 'three/webgpu';\nimport { type Vec3 } from './air-maths';\nexport interface SpotLight {\n    pos: Vec3;\n    dir: Vec3;\n    outer: number;\n    inner: number;\n    color: THREE.ColorRepresentation;\n    intensity: number;\n    reach?: number;\n}\nexport interface SheetLight {\n    pos: Vec3;\n    normal: Vec3;\n    u?: Vec3;\n    v?: Vec3;\n    half: [\n        number,\n        number\n    ];\n    thickness: number;\n    color: THREE.ColorRepresentation;\n    intensity: number;\n}\nexport interface GlowLight {\n    pos: Vec3;\n    color: THREE.ColorRepresentation;\n    intensity: number;\n    falloff: number;\n}\nexport interface AirSettings {\n    haze: number;\n    heightFall?: number;\n    floorY?: number;\n    noise?: number;\n    noiseScale?: number;\n    ambient?: THREE.ColorRepresentation;\n    ambientLevel?: number;\n    anisotropy?: number;\n    maxDistance?: number;\n    wind?: Vec3;\n}\nexport type LightSheetsTier = 'high' | 'medium' | 'low';\nexport declare const LIGHT_SHEETS_TIER: Record<LightSheetsTier, {\n    steps: number;\n    scale: number;\n}>;\nexport type LightSheetsOptions = {\n    spots?: number;\n    sheets?: number;\n    glows?: number;\n    steps?: number;\n    tier?: LightSheetsTier;\n    noise?: THREE.Data3DTexture;\n};\ntype SpotU = {\n    on: UniformNode<'float'>;\n    pos: UniformNode<'vec3'>;\n    dir: UniformNode<'vec3'>;\n    cone: UniformNode<'vec2'>;\n    color: UniformNode<'color'>;\n    fall: UniformNode<'float'>;\n};\ntype SheetU = {\n    on: UniformNode<'float'>;\n    pos: UniformNode<'vec3'>;\n    n: UniformNode<'vec3'>;\n    u: UniformNode<'vec3'>;\n    v: UniformNode<'vec3'>;\n    half: UniformNode<'vec2'>;\n    thick: UniformNode<'float'>;\n    color: UniformNode<'color'>;\n};\ntype GlowU = {\n    on: UniformNode<'float'>;\n    pos: UniformNode<'vec3'>;\n    color: UniformNode<'color'>;\n    fall: UniformNode<'float'>;\n};\nexport declare function noiseTexture(data?: Uint8Array<ArrayBufferLike>, size?: number): THREE.Data3DTexture;\nexport declare class LightSheets {\n    readonly noise: THREE.Data3DTexture;\n    readonly counts: {\n        spots: number;\n        sheets: number;\n        glows: number;\n    };\n    readonly u: {\n        on: THREE.UniformNode<\"float\", number>;\n        steps: THREE.UniformNode<\"int\", number>;\n        haze: THREE.UniformNode<\"float\", number>;\n        heightFall: THREE.UniformNode<\"float\", number>;\n        floorY: THREE.UniformNode<\"float\", number>;\n        maxDist: THREE.UniformNode<\"float\", number>;\n        noiseScale: THREE.UniformNode<\"float\", number>;\n        noiseAmp: THREE.UniformNode<\"float\", number>;\n        wind: THREE.UniformNode<\"vec3\", THREE.Vector3>;\n        seconds: THREE.UniformNode<\"float\", number>;\n        ambient: THREE.UniformNode<\"color\", THREE.Color>;\n        g: THREE.UniformNode<\"float\", number>;\n        surfaceGain: THREE.UniformNode<\"float\", number>;\n        projInv: THREE.UniformNode<\"mat4\", THREE.Matrix4>;\n        camWorld: THREE.UniformNode<\"mat4\", THREE.Matrix4>;\n        camPos: THREE.UniformNode<\"vec3\", THREE.Vector3>;\n    };\n    readonly spots: SpotU[];\n    readonly sheets: SheetU[];\n    readonly glows: GlowU[];\n    constructor(options?: LightSheetsOptions);\n    set steps(value: number);\n    get steps(): number;\n    air(o: AirSettings): this;\n    off(): this;\n    spot(i: number, s: SpotLight | null): this;\n    sheet(i: number, s: SheetLight | null): this;\n    glow(i: number, s: GlowLight | null): this;\n    darken(): this;\n    frame(camera: THREE.PerspectiveCamera | THREE.OrthographicCamera, seconds?: number): void;\n    node(color: Node, depth: TextureNode, options?: {\n        scale?: number;\n    }): Node<'vec4'>;\n    set resolution(scale: number);\n    get resolution(): number;\n    march(depth: TextureNode): Node<'vec4'>;\n    composite(color: Node, depth: TextureNode, marched: TextureNode): Node<'vec4'>;\n    surface(position: Node): Node<'vec3'>;\n    dispose(): void;\n}\nexport {};"
        }
      ],
      "pitfalls": [
        "The air is drawn after the scene from its colour and depth (a pass node’s output and depth)",
        "Call frame(camera, seconds) before every render, after the camera has moved",
        "March the air once into its own texture (convertToTexture) before bloom",
        "The scene pass renders into its own target (half float, multisampled), not the canvas",
        "The counts of spots, sheets and glows are fixed when it is made",
        "Nothing casts shadows in the air",
        "Sky pixels (depth 1) march to maxDistance",
        "Fewer steps are cheaper but coarser in the spots and glows (the sheets are exact at any count)",
        "On a weak GPU pass `tier` (LIGHT_SHEETS_TIER)",
        "The march is spread back by depth",
        "The march texture follows the canvas’s drawing-buffer size times the scale",
        "A sheet seen edge on would be endless",
        "surface() lines use fwidth",
        "In three r187 a scene’s lights are part of every material’s shader"
      ],
      "card": "entries/light-sheets.json"
    },
    {
      "id": "liquid-glass",
      "aliases": [],
      "name": "Liquid glass panels",
      "summary": "Glass slabs over live water, drawn by WebGPU (or its WebGL2 twin) behind ordinary DOM: refraction from each panel’s rounded-rectangle distance field, dispersion at the rim, frost, a pointer specular, contact shadows, and a context menu that wells up out of the pointer as one liquid blob. The same panels also go over your own WebGPU scene: frosted from four halvings of the finished picture, rims lit by the scene beside each edge, glass, solid, frame and shade kinds, hover and alert light, and the panels as a mask your other passes read.",
      "category": "ui",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "glassmorphism",
        "refraction",
        "sdf",
        "wgsl",
        "raw webgpu",
        "dom + gpu",
        "context menu",
        "caustics",
        "hud",
        "frosted glass",
        "mask",
        "webgl2 fallback"
      ],
      "useCases": [
        "dashboards and control panels",
        "hero sections",
        "context menus and popovers",
        "settings and onboarding screens",
        "game menus",
        "HUD panels over a 3D scene",
        "text over a picture or map"
      ],
      "interaction": "Click the water to ripple it · right-click anywhere for the menu",
      "kits": [
        {
          "kit": "product-presentation",
          "as": "optional"
        },
        {
          "kit": "shop",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "card-springs",
          "why": "Glass cards that lean under the hand"
        },
        {
          "id": "capability-tiers",
          "why": "A plain frosted panel where the GPU is weak"
        },
        {
          "id": "effects-switchboard",
          "why": "Let people still the water"
        }
      ],
      "variants": [],
      "version": "1.1.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "At most 1.5 pixels per CSS px; the menu pass skipped while no menu shows.",
          "low": "At most 1 pixel per CSS px (a phone draws a quarter of its pixels); the menu pass skipped while no menu shows."
        },
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "motion",
          "in": "module",
          "values": {
            "strict": 0,
            "refined": 1,
            "playful": 1
          },
          "note": "0 holds the water and ripples still"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 3.102,
          "cpuMs": 0.16,
          "cpuP95Ms": 0.25,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the water moving under five glass panels and three chips: two full-screen passes (water and glass, then the menu blob), timed with their own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.638,
          "cpuMs": 0.325,
          "cpuP95Ms": 0.55,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.65,
            "p99Ms": 17.775,
            "low1Fps": 55
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 1260 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 6.882,
          "cpuMs": 0.3,
          "cpuP95Ms": 0.38,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 167 ms."
        }
      ],
      "signatures": [
        {
          "file": "liquid-glass.ts",
          "declarations": "export type GlassTheme = 'day' | 'night' | 'sunset' | 'ocean';\nexport type GlassTier = 'high' | 'medium' | 'low';\nexport declare const GLASS_TIER: Record<GlassTier, {\n    ratio: number;\n    idleOver: boolean;\n}>;\nexport declare const glassRatio: (dpr: number, tier?: GlassTier) => number;\nexport type LiquidGlass = {\n    readonly api: 'webgpu' | 'webgl2';\n    frame(dt: number): void;\n    ripple(x: number, y: number, speed?: number): void;\n    setTheme(theme: GlassTheme): void;\n    setPalette(colours: string[]): void;\n    motion: number;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare function createLiquidGlass(host: HTMLElement, { overZ, theme, palette, tier, webgl }?: {\n    overZ?: number | undefined;\n    theme?: GlassTheme | undefined;\n    palette?: string[] | undefined;\n    tier?: GlassTier | undefined;\n    webgl?: boolean | undefined;\n}): Promise<LiquidGlass | null>;"
        },
        {
          "file": "scene-glass-gl.ts",
          "declarations": "import { type SceneGlassFrame, type SceneGlassLook, type SceneGlassRect } from './scene-glass';\nexport type SceneGlassGL = {\n    setPanels(rects: readonly SceneGlassRect[], frame: SceneGlassFrame): boolean;\n    setLook(look: Partial<SceneGlassLook>): void;\n    encode(picture: WebGLTexture, width: number, height: number, target: WebGLFramebuffer | null): void;\n    readonly data: Float32Array;\n    dispose(): void;\n};\nexport declare function createSceneGlassGL(gl: WebGL2RenderingContext, { look }?: {\n    look?: Partial<SceneGlassLook> | undefined;\n}): SceneGlassGL;"
        },
        {
          "file": "scene-glass.ts",
          "declarations": "export type SceneGlassKind = 'glass' | 'frame' | 'solid' | 'shade';\nexport type SceneGlassRect = {\n    x: number;\n    y: number;\n    width: number;\n    height: number;\n    radius: number;\n    kind: SceneGlassKind;\n    hover?: number;\n    alert?: number;\n};\nexport type SceneGlassLook = {\n    tint: string;\n    tintAlpha: number;\n    rim: string;\n    bounce: number;\n    hover: string;\n    hoverStrength: number;\n    alert: string;\n    alertStrength: number;\n    shade: number;\n};\nexport declare const SCENE_GLASS_LOOK: SceneGlassLook;\nexport type SceneGlassFrame = {\n    dpr: number;\n    pointer?: {\n        x: number;\n        y: number;\n    };\n    time?: number;\n    motion?: number;\n};\nexport type SceneGlass = {\n    setPanels(rects: readonly SceneGlassRect[], frame: SceneGlassFrame): boolean;\n    setLook(look: Partial<SceneGlassLook>): void;\n    encode(encoder: GPUCommandEncoder, picture: GPUTexture, target: GPUTextureView, timestampWrites?: GPURenderPassTimestampWrites): void;\n    readonly buffer: GPUBuffer;\n    dispose(): void;\n};\nexport declare function createSceneGlass(device: GPUDevice, { format, look }: {\n    format: GPUTextureFormat;\n    look?: Partial<SceneGlassLook>;\n}): Promise<SceneGlass>;\nexport type GlassRectsOptions = {\n    kinds?: Record<string, SceneGlassKind>;\n};\nexport declare function watchGlassRects(host: HTMLElement, { kinds }?: GlassRectsOptions): {\n    read(dt: number, motion?: number): SceneGlassRect[];\n};"
        }
      ],
      "pitfalls": [
        "Give marked elements a transparent background",
        "Each frame reads every marked element’s rect (getBoundingClientRect)",
        "A corner radius is read from CSS once per element and cached",
        "The canvases are premultiplied alpha",
        "On a weak GPU pass `tier` (GLASS_TIER)",
        "Never queue more than one frame ahead",
        "The pipelines compile in the background (createRenderPipelineAsync)",
        "Without WebGPU, createLiquidGlass draws the same glass with WebGL2 by itself",
        "Over a scene, the glass pass is the last thing drawn",
        "Over a scene, setPanels() takes the pixel ratio of the picture to the host",
        "Hover and alert light only tint the rim and a thin band inside it"
      ],
      "card": "entries/liquid-glass.json"
    },
    {
      "id": "list-smarts",
      "aliases": [],
      "name": "Shopping-list smarts: aisle order, due again, quantities",
      "summary": "The small smarts that make a shared shopping or packing list feel like it knows you, as pure, tested functions. Sections sort the way this person walks the shop, learned from the order they tick things off; things they buy regularly come back as “due again” suggestions once their usual gap has nearly passed; “2 milk”, “500 g flour”, “flour x3” and “a bag of rice” are read into a name and an amount, and amounts of the same thing add up (500 g and 1 kg make 1.5 kg); streaks and counts are kept on the server, which refuses a phone’s own numbers. English first, no dependencies.",
      "category": "data",
      "role": "system",
      "stack": [
        "headless"
      ],
      "character": "calm",
      "tags": [
        "lists",
        "shopping list",
        "learning",
        "personalisation",
        "suggestions",
        "recurrence",
        "running average",
        "parsing",
        "quantities",
        "units",
        "plurals",
        "autocomplete",
        "duplicates",
        "streaks",
        "time zones",
        "server rules",
        "gamification",
        "pure",
        "tested",
        "no dependencies"
      ],
      "useCases": [
        "shopping and grocery lists that sort themselves by aisle",
        "packing, chores and stock lists with things that recur",
        "“you usually buy this every week” suggestions",
        "typing a quantity and a thing in one go",
        "streaks and achievements a client can’t fake",
        "spotting a duplicate before it is added twice"
      ],
      "interaction": "Swipe a row right to tick it off, left to remove · tick in your own order, or press Walk the shop, and watch the sections learn · Next day brings things due again · type “2 milk”",
      "kits": [
        {
          "kit": "shop",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "offline-sync",
          "why": "Shared lists that work with no signal"
        },
        {
          "id": "swipe-actions",
          "why": "Swipe items off the list"
        },
        {
          "id": "drag-reorder",
          "why": "Reorder sections by hand"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.18,
            "p99Ms": 21.135,
            "low1Fps": 43.1
          },
          "notes": "Measured with the demo shopping by itself: it adds what is due, walks the shop ticking a row every 250 ms (each tick re-sorts the list with a FLIP move and may learn the order), finishes, and moves to the next day, then starts over after two weeks. The smarts are pure functions of a few dozen records: well under a millisecond each; the cost is the list being drawn again."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 97 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 162 ms."
        }
      ],
      "signatures": [
        {
          "file": "amounts.ts",
          "declarations": "export type Amount = {\n    n: number;\n    unit?: string;\n};\nexport type Entry = {\n    name: string;\n    amount?: Amount;\n    qty?: string;\n};\nexport declare const UNITS: Record<string, {\n    words: string[];\n    counted?: boolean;\n    plural?: string;\n}>;\nexport declare function readNumber(text: string): number;\nexport declare function formatAmount(a: Amount): string;\nexport declare function parseAmount(text: string | undefined): Amount | null;\nexport declare function parseEntry(text: string): Entry;\nexport declare function tidy(name: string): string;\nexport declare const keyOf: (name: string) => string;\nexport declare function itemKey(name: string): string;\nexport declare function addQty(a: string | undefined, b: string | undefined): string;\nexport declare function findDuplicate<T extends {\n    name: string;\n}>(name: string, open: readonly T[]): T | undefined;\nexport declare function autocomplete(query: string, own: readonly {\n    name: string;\n    n: number;\n}[], known?: readonly string[], max?: number): string[];"
        },
        {
          "file": "due.ts",
          "declarations": "export declare const DAY = 86400000;\nexport type Stat = {\n    id: string;\n    name: string;\n    section?: string;\n    list?: string;\n    n: number;\n    last: number;\n    every?: number;\n    snooze?: number;\n};\nexport type DueTuning = {\n    weight: number;\n    sameShop: number;\n    threshold: number;\n    max: number;\n};\nexport declare const DUE_TUNING: DueTuning;\nexport declare function learnPurchase(old: Stat | undefined, item: {\n    name: string;\n    section?: string;\n    list?: string;\n}, now: number, tuning?: Partial<DueTuning>): Stat;\nexport type Due = {\n    stat: Stat;\n    due: number;\n};\nexport declare function dueSuggestions(stats: readonly Stat[], open: readonly {\n    name: string;\n}[], now: number, options?: Partial<DueTuning> & {\n    list?: string;\n}): Due[];\nexport declare const snoozeStat: (stat: Stat, now: number, days?: number) => Stat;\nexport declare function describeDue(d: Due, now: number): string;"
        },
        {
          "file": "order.ts",
          "declarations": "export declare function walkingOrder(own: readonly string[] | undefined, sections: readonly string[]): string[];\nexport declare function learnOrder(order: readonly string[], prev: string | null, section: string): string[] | null;\nexport type Walk = {\n    tick(section: string, order: readonly string[], now: number): string[] | null;\n    reset(): void;\n    readonly last: string | null;\n};\nexport declare function createWalk({ sameWalk }?: {\n    sameWalk?: number;\n}): Walk;\nexport type Grouped<T> = {\n    section: string;\n    items: T[];\n};\nexport declare function groupBySection<T extends {\n    section: string;\n    at: number;\n    urgent?: boolean;\n}>(items: readonly T[], order: readonly string[], fallback?: string): Grouped<T>[];\nexport type Dictionary = Record<string, readonly string[]>;\nexport declare function sectionGuesser(dictionary: Dictionary, fallback?: string): (name: string, learned?: Readonly<Record<string, string>>) => string;\nexport declare const knownWords: (dictionary: Dictionary) => string[];"
        },
        {
          "file": "streaks.ts",
          "declarations": "export type Tally<C extends string = string> = {\n    counts: Record<C, number>;\n    days: number;\n    streak: number;\n    best: number;\n    day: string;\n    at: number;\n};\nexport declare function emptyTally<C extends string>(counters: readonly C[]): Tally<C>;\nexport declare function dayKey(at: number, timeZone?: string): string;\nexport declare function previousDay(day: string): string;\nexport declare function countActivity<C extends string>(old: Tally<C>, change: Partial<Record<C, number>>, now: number, { timeZone, active }?: {\n    timeZone?: string;\n    active?: boolean;\n}): Tally<C>;\nexport declare function liveStreak(t: Tally, now: number, timeZone?: string): number;\nexport type WriteRules = Record<string, readonly string[] | 'any'>;\nexport declare function clientPatch(rules: WriteRules, kind: string, patch: Record<string, unknown>): Record<string, unknown> | null;\nexport type Goal<C extends string = string> = {\n    id: string;\n    label: string;\n    value: (t: Tally<C>) => number;\n    goal: number;\n};\nexport type Progress<C extends string = string> = {\n    goal: Goal<C>;\n    value: number;\n    done: boolean;\n    share: number;\n};\nexport declare function progressOf<C extends string>(t: Tally<C> | undefined, goals: readonly Goal<C>[]): Progress<C>[];\nexport declare function nextUp<C extends string>(t: Tally<C> | undefined, goals: readonly Goal<C>[], count?: number): Progress<C>[];"
        }
      ],
      "pitfalls": [
        "Count streaks and gaps where the phone can’t write them",
        "A day is a calendar day in the list’s time zone, so pass one (dayKey(now, 'Europe/London'))",
        "“Yesterday” must be the calendar day before (previousDay), not 24 hours back",
        "The stored streak only changes when the person does something, so read it with liveStreak()",
        "learnOrder only moves a section later, to just after the one ticked before it",
        "Ticks further apart than one walk (10 minutes by default) teach nothing about each other",
        "A suggestion needs a thing bought at least twice, and the gap is counted once a shop",
        "The parser is English first",
        "Names are compared by itemKey, which takes an English plural off the last word"
      ],
      "card": "entries/list-smarts.json"
    },
    {
      "id": "lit-height-fog",
      "aliases": [],
      "name": "Lit height fog",
      "summary": "Fog that fills the low ground and glows round the lights in it, in one full-screen pass over any scene with a depth buffer (WebGPU, or WebGL2 where it is missing): exponential height fog in closed form (no march), the sun scattered by Henyey–Greenstein, point lights and beams lighting the air round them by the closed-form airlight integral, and a low layer of drifting wisps lit from below by a light field (lights splatted from above into a small HDR texture your ground can read too).",
      "category": "post",
      "role": "hero-visual",
      "stack": [
        "webgpu"
      ],
      "character": "balanced",
      "tags": [
        "fog",
        "height fog",
        "atmosphere",
        "light scattering",
        "airlight",
        "post-processing",
        "raw webgpu",
        "wgsl",
        "glsl",
        "webgl2 fallback",
        "analytic",
        "night scenes"
      ],
      "useCases": [
        "valleys, harbours and cities at night",
        "beacons, street lamps and headlights glowing in mist",
        "maps and 3D overviews that fade with distance",
        "game worlds and flight views",
        "dusk and dawn moods over any scene",
        "depth cues for terrain"
      ],
      "interaction": "Drag to orbit · wheel or + − to zoom · Fly low into the valley",
      "kits": [],
      "pairsWith": [
        {
          "id": "physical-sky",
          "why": "The sun it scatters"
        },
        {
          "id": "cinematic-lens",
          "why": "Bloom and a grade after the fog"
        },
        {
          "id": "volumetric-mist",
          "why": "Moving mist close to the camera"
        }
      ],
      "variants": [],
      "version": "1.2.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 8.5,
          "cpuMs": 0.195,
          "cpuP95Ms": 0.285,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured at night on the slow orbit: 40 lights moving along the valleys and six beacons splatted into a 256² light field, a 256 × 256 ground and the sky, the fog pass (six beacons glowing in the air, the wisp layer at 8 steps), the beams and lights after it and a tone pass, all timed together with timestamp queries. A living scene, so it draws every frame; with Moving lights and Slow orbit off (and under reduced motion) it draws only when something changes."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 4.981,
          "cpuMs": 0.35,
          "cpuP95Ms": 0.485,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 343 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.58,
          "cpuP95Ms": 0.7,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 907 ms."
        }
      ],
      "signatures": [
        {
          "file": "lit-height-fog-gl.ts",
          "declarations": "import { type FogLight, type FogSettings } from './lit-height-fog';\nimport { type FogDepthKind } from './fog-wgsl';\nexport { FOG_FUNCTIONS_GLSL, LIGHT_FIELD_READ_GLSL } from './fog-glsl';\nexport type FogCameraGL = {\n    invViewProj: ArrayLike<number>;\n    position: [\n        number,\n        number,\n        number\n    ];\n    forward?: [\n        number,\n        number,\n        number\n    ];\n};\nexport type FieldSourceGL = {\n    texture: WebGLTexture;\n    rect: readonly [\n        number,\n        number,\n        number,\n        number\n    ];\n};\nexport type FogDrawGL = {\n    scene: WebGLTexture;\n    depth: WebGLTexture;\n    target: WebGLFramebuffer | null;\n    width: number;\n    height: number;\n    camera: FogCameraGL;\n    lightField?: FieldSourceGL | null;\n    time?: number;\n};\nexport type HeightFogGL = {\n    settings: FogSettings;\n    lights: FogLight[];\n    draw(d: FogDrawGL): void;\n    dispose(): void;\n};\nexport type HeightFogOptionsGL = {\n    depth?: FogDepthKind;\n    settings?: Partial<FogSettings>;\n};\nexport declare function createHeightFogGL(gl: WebGL2RenderingContext, { depth, settings }?: HeightFogOptionsGL): HeightFogGL;\nexport type LightFieldGL = FieldSourceGL & {\n    rect: [\n        number,\n        number,\n        number,\n        number\n    ];\n    width: number;\n    height: number;\n    splat(lights: readonly FogLight[]): void;\n    dispose(): void;\n};\nexport declare function createLightFieldGL(gl: WebGL2RenderingContext, { rect, size, maxLights }: {\n    rect: [\n        number,\n        number,\n        number,\n        number\n    ];\n    size?: number;\n    maxLights?: number;\n}): LightFieldGL | null;"
        },
        {
          "file": "lit-height-fog.ts",
          "declarations": "import { type FogDepthKind } from './fog-wgsl';\nexport { FOG_FUNCTIONS_WGSL, LIGHT_FIELD_READ_WGSL, MAX_FOG_LIGHTS, type FogDepthKind } from './fog-wgsl';\nexport type Vec3 = [\n    number,\n    number,\n    number\n];\nexport type FogLight = {\n    position: Vec3;\n    colour: Vec3;\n    intensity?: number;\n    height?: number;\n    radius?: number;\n};\nexport type FogSettings = {\n    density: number;\n    falloff: number;\n    base: number;\n    colour: Vec3;\n    sunDirection: Vec3;\n    sunColour: Vec3;\n    anisotropy: number;\n    lightScatter: number;\n    haze: number;\n    skyFog: number;\n    skyDistance: number;\n    layerSteps: number;\n    layerTop: number;\n    layerRange: number;\n    layerDensity: number;\n    wisps: number;\n    wispSize: number;\n    wind: [\n        number,\n        number\n    ];\n    fieldGlow: number;\n};\nexport declare const DEFAULT_FOG: FogSettings;\nexport type FogCamera = {\n    invViewProj: ArrayLike<number>;\n    position: Vec3;\n    forward?: Vec3;\n};\nexport type FieldSource = {\n    view: GPUTextureView;\n    rect: readonly [\n        number,\n        number,\n        number,\n        number\n    ];\n};\nexport type FogDraw = {\n    encoder: GPUCommandEncoder;\n    scene: GPUTextureView;\n    depth: GPUTextureView;\n    target: GPUTextureView;\n    camera: FogCamera;\n    lightField?: FieldSource | null;\n    time?: number;\n    timestampWrites?: GPURenderPassTimestampWrites;\n};\nexport type HeightFog = {\n    settings: FogSettings;\n    lights: FogLight[];\n    draw(d: FogDraw): void;\n    dispose(): void;\n};\nexport type HeightFogOptions = {\n    format?: GPUTextureFormat;\n    depth?: FogDepthKind;\n    settings?: Partial<FogSettings>;\n};\nexport declare function createHeightFog(device: GPUDevice, { format, depth, settings }?: HeightFogOptions): Promise<HeightFog>;\nexport type LightField = FieldSource & {\n    texture: GPUTexture;\n    rect: [\n        number,\n        number,\n        number,\n        number\n    ];\n    splat(encoder: GPUCommandEncoder, lights: readonly FogLight[]): void;\n    dispose(): void;\n};\nexport type LightFieldOptions = {\n    rect: [\n        number,\n        number,\n        number,\n        number\n    ];\n    size?: number;\n    maxLights?: number;\n};\nexport declare function createLightField(device: GPUDevice, { rect, size, maxLights }: LightFieldOptions): Promise<LightField>;"
        }
      ],
      "pitfalls": [
        "The pass reads the scene’s colour and writes another texture",
        "Depth is WebGPU’s 0..1 with 1 far by default",
        "Pixels at the far plane count as sky, skyDistance away",
        "Draw glowing things (beams, sprites, emissive lamps) after the fog and multiply them by…",
        "The airlight is a closed form for even air and no shadows",
        "At most 16 point lights glow in the air",
        "The uniform is written with queue.writeBuffer, so draw() once per submit",
        "The low layer is a short march with per-pixel jitter that changes every frame",
        "On WebGL2 (createHeightFogGL) depth is GL’s",
        "Splat small lights with a radius of at least two or three of the field’s texels"
      ],
      "card": "entries/lit-height-fog.json"
    },
    {
      "id": "loading-states",
      "aliases": [],
      "name": "Loading, empty and error states",
      "summary": "The states every view needs, done calmly: a tiny state machine (idle → loading → slow → ready | empty | error) with a grace delay so fast loads never flash a skeleton and a minimum once one shows; skeletons in the shape of their content with one CSS sweep; known and indeterminate progress; three different empty states; errors with retry that keep what was showing; aria-busy, focus kept and a polite line when content arrives. Restyle it through its parts.",
      "category": "ui",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "loading",
        "skeleton",
        "shimmer",
        "empty state",
        "error state",
        "retry",
        "progress bar",
        "state machine",
        "aria-busy",
        "live region",
        "abort",
        "accessibility",
        "dom",
        "css",
        "no dependencies"
      ],
      "useCases": [
        "lists, grids and tables that fetch",
        "search as you type",
        "dashboards and panels that refresh",
        "imports and uploads with progress",
        "first-run screens",
        "offline and server errors"
      ],
      "interaction": "Pick a network speed in the controls · search, filter to starred, switch list, cards and table · watch the strip",
      "kits": [
        {
          "kit": "foundations",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "data-table",
          "why": "Skeleton rows and empty and error states"
        },
        {
          "id": "file-drop",
          "why": "States for uploads"
        },
        {
          "id": "phone-app-shell",
          "why": "Offline states for a cached app"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "motion",
          "in": "module",
          "values": {
            "strict": "still",
            "refined": "pulse",
            "playful": "sweep"
          },
          "note": "how a skeleton moves"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0.05,
          "cpuP95Ms": 0.085,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the demo reloading itself cold every 2.6 s on the 2 s network and cycling list, cards and table, so most frames show a sweeping skeleton and every few seconds one is swapped for content. The per-frame script is only the teaching timeline; the sweep is one CSS animation and costs no script at all."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.06,
          "cpuP95Ms": 0.135,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 87 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.04,
          "cpuP95Ms": 0.1,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 53 ms."
        }
      ],
      "signatures": [
        {
          "file": "loader.ts",
          "declarations": "import type { LoadState, Timing } from './machine';\nexport type LoadContext = {\n    signal: AbortSignal;\n    progress(value: number | null): void;\n    attempt: number;\n};\nexport type LoadFn<T> = (ctx: LoadContext) => Promise<T>;\nexport type LoaderOptions<T> = Partial<Timing> & {\n    load: LoadFn<T>;\n    isEmpty?: (data: T) => boolean;\n    timeout?: number;\n    onChange?: (state: LoadState<T>, previous: LoadState<T>) => void;\n    now?: () => number;\n};\nexport type Loader<T> = {\n    readonly state: LoadState<T>;\n    run(options?: {\n        fresh?: boolean;\n        load?: LoadFn<T>;\n    }): void;\n    retry(): void;\n    cancel(): void;\n    reset(): void;\n    configure(options: Partial<Timing> & {\n        isEmpty?: (data: T) => boolean;\n        timeout?: number;\n    }): void;\n    subscribe(fn: (state: LoadState<T>, previous: LoadState<T>) => void): () => void;\n    dispose(): void;\n};\nexport declare function createLoader<T>(options: LoaderOptions<T>): Loader<T>;"
        },
        {
          "file": "machine.ts",
          "declarations": "export type Phase = 'idle' | 'loading' | 'slow' | 'ready' | 'empty' | 'error';\nexport type Timing = {\n    delay: number;\n    minShow: number;\n    slowAfter: number;\n};\nexport declare const DEFAULT_TIMING: Timing;\nexport type MachineConfig<T> = Timing & {\n    isEmpty?: (data: T) => boolean;\n};\nexport type Outcome<T> = {\n    ok: true;\n    data: T;\n} | {\n    ok: false;\n    error: unknown;\n};\nexport type LoadState<T> = {\n    phase: Phase;\n    indicator: boolean;\n    progress: number | null;\n    data: T | undefined;\n    error: unknown;\n    startedAt: number;\n    shownAt: number | null;\n    held: Outcome<T> | null;\n    attempt: number;\n};\nexport type LoadEvent<T> = {\n    type: 'start';\n    at: number;\n    fresh?: boolean;\n} | {\n    type: 'tick';\n    at: number;\n} | {\n    type: 'progress';\n    value: number | null;\n} | {\n    type: 'settle';\n    at: number;\n    outcome: Outcome<T>;\n} | {\n    type: 'cancel';\n} | {\n    type: 'reset';\n};\nexport declare const initialState: <T>() => LoadState<T>;\nexport declare const isBusy: (s: {\n    phase: Phase;\n}) => boolean;\nexport declare function step<T>(s: LoadState<T>, e: LoadEvent<T>, config: MachineConfig<T>): LoadState<T>;\nexport declare function nextWake<T>(s: LoadState<T>, config: Timing): number | null;\nexport type EmptyKind = 'first-use' | 'no-results' | 'filtered';\nexport declare function emptyKind(counts: {\n    total: number;\n    matches: number;\n    shown: number;\n}): EmptyKind | null;\nexport type ErrorKind = 'offline' | 'timeout' | 'not-found' | 'denied' | 'server' | 'unknown';\nexport declare function errorKind(error: unknown, online?: boolean): ErrorKind;"
        },
        {
          "file": "states.ts",
          "declarations": "import type { ErrorKind, LoadState } from './machine';\nimport type { Loader } from './loader';\nexport type Motion = 'sweep' | 'pulse' | 'still';\nexport declare function bone(shape?: 'line' | 'block' | 'circle', width?: string | number, height?: string): HTMLSpanElement;\nexport declare function boneLines(count: number, options?: {\n    last?: number;\n    offset?: number;\n}): HTMLSpanElement;\nexport declare function skeleton(content: Node | Node[], options?: {\n    label?: string;\n    motion?: Motion;\n}): HTMLDivElement;\nexport declare function skeletonList(rows: number, options?: {\n    rowClass?: string;\n    avatar?: boolean;\n    lines?: number;\n    end?: boolean;\n}): HTMLDivElement;\nexport declare function skeletonCards(count: number, options?: {\n    gridClass?: string;\n    cardClass?: string;\n    media?: string | false;\n    lines?: number;\n}): HTMLDivElement;\nexport type SkeletonColumn = {\n    label: string;\n    align?: 'start' | 'end';\n    width?: string | number;\n};\nexport declare function skeletonTable(columns: SkeletonColumn[], rows: number, options?: {\n    tableClass?: string;\n}): HTMLTableElement;\nexport type ProgressBar = {\n    el: HTMLElement;\n    set(value: number | null, text?: string): void;\n};\nexport declare function progressBar(options: {\n    label: string;\n    value?: number | null;\n    className?: string;\n}): ProgressBar;\nexport type MessageIcon = 'empty' | 'search' | 'filter' | 'error' | 'offline' | 'time';\nexport type MessageAction = {\n    label: string;\n    onClick: () => void;\n    primary?: boolean;\n    focus?: boolean;\n};\nexport type MessageOptions = {\n    title: string;\n    body?: string;\n    icon?: MessageIcon | Node;\n    tone?: 'neutral' | 'bad';\n    actions?: MessageAction[];\n    level?: 0 | 2 | 3 | 4 | 5 | 6;\n    compact?: boolean;\n};\nexport declare function stateMessage(options: MessageOptions): HTMLDivElement;\nexport declare const ERROR_WORDS: Record<ErrorKind, {\n    title: string;\n    body: string;\n    icon: MessageIcon;\n}>;\nexport declare function errorMessage(error: unknown, retry: () => void, options?: {\n    compact?: boolean;\n    level?: MessageOptions['level'];\n}): HTMLDivElement;\nexport declare function announcer(parent: HTMLElement): {\n    el: HTMLParagraphElement;\n    say(text: string): void;\n    dispose(): void;\n};\nexport type RegionViews<T> = {\n    label: string;\n    skeleton(): Node;\n    content(data: T): Node;\n    empty(data: T): Node;\n    error?(error: unknown, ctx: {\n        retry(): void;\n    }): Node;\n    banner?(error: unknown, ctx: {\n        retry(): void;\n    }): Node;\n    slow?(ctx: {\n        cancel(): void;\n    }): Node;\n    announce?(state: LoadState<T>, previous: LoadState<T>): string | null | undefined;\n    motion?: Motion;\n    notice?: 'above' | 'reserved' | HTMLElement;\n};\nexport type StateRegion = {\n    refresh(): void;\n    setMotion(motion: Motion): void;\n    say(text: string): void;\n    dispose(): void;\n};\nexport declare function stateRegion<T>(host: HTMLElement, loader: Loader<T>, views: RegionViews<T>): StateRegion;"
        }
      ],
      "pitfalls": [
        "By default the slow note and a failed refresh’s line are put in a slot above the content",
        "Import loading-states.base.css, then loading-states.css (or your own look instead)",
        "Pass ctx.signal to fetch",
        "A skeleton only prevents a jump if it matches",
        "The minimum on screen can hold a result back by up to minShow ms after it arrived",
        "isEmpty is about the server’s answer",
        "Do not put the live region inside the aria-busy element",
        "background-attachment: fixed is ignored on iOS Safari, so there each bone runs its own sweep",
        "A refresh that fails keeps the old content with a banner (phase error, data kept)",
        "Reduced motion stops both the sweep and the pulse and makes the indeterminate bar still"
      ],
      "card": "entries/loading-states.json"
    },
    {
      "id": "low-poly-props",
      "aliases": [],
      "name": "Low-poly props",
      "summary": "Coastal and village set dressing in one faceted low-poly style, each prop from a few numbers and a seed: houses (footprint, storeys, roof type and pitch, windows a storey, a door, a chimney, lit windows), a church with a spire, a pier on posts with rails, a lighthouse in bands with a gallery and a lantern that glows, rocks, fences along a path, and cheap trees (conifer, broadleaf, palm, dead), plus rows of houses along a street or a quay. Built on the shape kit’s core, so every part is closed, wound outward and UV’d in metres; colour rides on the vertices from one palette with seeded variation, so a whole harbour village is about ten draws at forty houses or two hundred and fifty, and builds in about a tenth of a second (a third at 250 houses). A night switch lights the lamps and windows without building a shader.",
      "category": "technique",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "balanced",
      "tags": [
        "procedural",
        "low poly",
        "props",
        "buildings",
        "houses",
        "village",
        "harbour",
        "lighthouse",
        "pier",
        "rocks",
        "trees",
        "fence",
        "seeded",
        "vertex colours",
        "draw calls",
        "set dressing",
        "three.js",
        "webgpu",
        "webgl",
        "no dependencies"
      ],
      "useCases": [
        "a harbour town, a village or a coast made in code, loaded at once with no model files",
        "background buildings and set dressing for a game, a map or a weather view",
        "seeded scenery: the same seed gives the same town on every visit",
        "an agent building a scene from a description, with closed geometry guaranteed"
      ],
      "interaction": "Drag to look round the harbour · change the seed, the number of houses and the trees · turn night on to light the windows and the lantern",
      "kits": [],
      "pairsWith": [
        {
          "id": "shape-kit",
          "why": "Make your own props in the same closed, metre-UV way"
        },
        {
          "id": "growing-tree",
          "why": "A hero tree where the set-dressing ones would look plain"
        },
        {
          "id": "auto-instancer",
          "why": "Batch props a scene places by hand, one by one"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 0.342,
          "cpuMs": 0.26,
          "cpuP95Ms": 0.39,
          "badge": "light",
          "drawCalls": 24,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.122,
            "p99Ms": 6.49,
            "low1Fps": 139.7
          },
          "notes": "The default village (seed 7, about forty houses, a church, a shed, a pier, a lighthouse, 26 rocks, a fence and 32 trees), built once at start, by day, with sun shadows (the library’s sun-shadow: a 2,048-px map fitted to the view each frame, the tent filter). The frame cost is drawing it: about a dozen draws a pass, and the shadow pass."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "intel xe-2lpg",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Microsoft Edge 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 2.195,
          "cpuMs": 0.59,
          "cpuP95Ms": 0.86,
          "badge": "heavy",
          "drawCalls": 24,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Microsoft Edge 157, Chromium 157 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 358 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 1.726,
          "cpuMs": 0.32,
          "cpuP95Ms": 0.9,
          "badge": "moderate",
          "drawCalls": 24,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 425 ms."
        }
      ],
      "signatures": [
        {
          "file": "low-poly-props.ts",
          "declarations": "export * from './kit';\nexport * from './shapes';\nexport * from './check';\nexport * from './three-kit';\nexport * from './props';\nexport * from './three-props';"
        }
      ],
      "pitfalls": [
        "Merge, don’t add one by one",
        "Vertex colours carry the palette",
        "The colours are linear RGB, as vertex colours are",
        "A house stands on y = 0 with its front to +z",
        "Gable and shed roofs need a rectangular footprint (houses are rectangles)",
        "The trees are set dressing",
        "Night lights the \"lamp\" slot by its emissive strength",
        "The kit’s core in module/ is a copy of shape-kit’s",
        "Building is CPU work at load"
      ],
      "card": "entries/low-poly-props.json"
    },
    {
      "id": "material-designer",
      "aliases": [],
      "name": "PBR material designer",
      "summary": "Material presets by name: material(‘weathered-wood’, { style }) gives one of 39 at their real-world size, at once, and one switch turns every material it made realistic (baked), painterly, flat or toon. Behind them, materials as recipes you can keep in a repo: a stack of procedural layers (noise, cells, bricks and tiles, wood, marble, scratches, weave, dents, flakes, scattered shapes, panels with rivets, tread plate and grilles, scales and shingles, strata, ripples, drips, your own image) and operations (slope and directional blur, bevel, curvature, a value per shape, detail normals) baked on the GPU into seamless tiling maps in milliseconds, drawn by a physical node material with normal, parallax occlusion or true displaced relief, by UV or triplanar, with wear that follows each object. Car paint (after the vehicle showcase) turns the base into a coat that flops through three tones with the angle, with flakes that only add light and never shimmer, pearl and candy tints, under the stack’s own layers and wear. Whole materials layer over each other by height (paint over rust over steel, moss in the mortar, snow on tiles), translucent ones scatter light, large surfaces break up their repeat with hex tiling, and parallax relief shades itself. At render time, lava flows, surfaces get wet with puddles and rain rings, snow settles, and a dissolve burns away under an app’s control. A live designer edits the stack as a tree with undo, a before/after split, views of each layer’s field and mask, notes on what each layer hides, and 69 presets in eight groups (grime to lay over other surfaces, tree crowns of needle sprays and veined leaves, and car paints among them), your own glTF model and HDR, a material ball, and exports PNG maps (glTF ORM, OpenGL or DirectX normals, 16-bit height) and the recipe as JSON. What you make is saved in the browser: your own materials with thumbnails, your versions of presets (reverted with Undo), drafts of unsaved changes, a backup file, and the code to make one a preset.",
      "category": "surface",
      "role": "hero-visual",
      "stack": [
        "three",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "material presets",
        "toon",
        "painterly",
        "flat shading",
        "style switch",
        "pbr",
        "procedural textures",
        "car paint",
        "metallic flakes",
        "pearlescent",
        "layered materials",
        "height blend",
        "subsurface scattering",
        "hex tiling",
        "tiling breakup",
        "parallax shadows",
        "flow",
        "wetness",
        "rain",
        "snow",
        "dissolve",
        "gltf",
        "scatter",
        "sci-fi panels",
        "slope blur",
        "detail normal",
        "texture baking",
        "material editor",
        "parallax occlusion mapping",
        "displacement",
        "triplanar",
        "tiling",
        "png export",
        "tsl",
        "render targets",
        "edge wear",
        "undo",
        "save",
        "local storage",
        "drafts"
      ],
      "useCases": [
        "a good material by name in one call",
        "one look for a whole scene: realistic, painterly, flat or toon",
        "game materials without texture files",
        "stone, brick, wood, metal, fabric, glass and lava",
        "material editors and look-dev tools",
        "tiling texture sets for other engines",
        "worn props and set dressing",
        "product and finish previews"
      ],
      "interaction": "Pick a layer and drag its sliders: it re-bakes from that layer · Drag layers into and out of material layers · Show its field or mask · Presets, Split, Tile, Export · Ctrl+Z",
      "kits": [
        {
          "kit": "product-presentation",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "card-material",
          "why": "One lit surface for quick finishes"
        },
        {
          "id": "wear-grime",
          "why": "Wear and dirt over the materials"
        },
        {
          "id": "vehicle-showcase",
          "why": "Paint and trims on a staged vehicle"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 0.631,
          "cpuMs": 0.2,
          "cpuP95Ms": 0.33,
          "badge": "moderate",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Red brick on the rounded cube, 1K bake, parallax relief, studio light, on a slow turntable; once a second a mid-stack layer changes and the stack re-bakes from it (a few passes and the final one)."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 4.555,
          "cpuMs": 1.052,
          "cpuP95Ms": 1.825,
          "badge": "heavy",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 10.865,
            "p99Ms": 80.425,
            "low1Fps": 10.1
          },
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 8705 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 3.789,
          "cpuMs": 0.34,
          "cpuP95Ms": 0.58,
          "badge": "heavy",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 6401 ms."
        },
        {
          "machine": "reference",
          "reference": true,
          "view": "presets",
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 0.054,
          "cpuMs": 0.55,
          "cpuP95Ms": 0.79,
          "badge": "moderate",
          "drawCalls": 41,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 4.51,
            "p99Ms": 7.835,
            "low1Fps": 117.9
          },
          "notes": "The material presets view: all 39 presets of material(name) on spheres in the realistic style at 256², studio light, measured once every bake is done and every shader compiled (the view waits for both before its first frame)."
        }
      ],
      "signatures": [
        {
          "file": "material-designer.ts",
          "declarations": "export * from './recipe';\nexport { PRESET_GROUPS, PRESETS, PRESET_NAMES, type PresetGroup } from './presets';\nexport { imageToDataUrl } from './image';\nexport { halfToFloat, MaterialBaker, PROBE_SIZE, type BakeStats, type Maps } from './bake';\nexport { coverage, OUTPUTS, writes, type CoverageNote, type LayerCoverage, type LayerProbe, type Output, type OutputCoverage } from './coverage';\nexport { auditFailures, auditProbes, auditRecipe, compareMaps, THRESHOLDS, verdict, VISIBLE, type AuditReport, type Change, type Difference, type MapSet, type Probe, type ProbeResult, type Verdict } from './audit';\nexport { createRecipeMaterial, RecipeMaterial, RecipeNodeMaterial, CHANNELS, type Channel, type PrepareDraw, type Projection, type RecipeMaterialOptions } from './material';\nexport { compileFor, disposeInTurn, inTurn, nextFrame } from './compile';\nexport { previewShape, SHAPE_KINDS, EDGE_ATTRIBUTE, type PreviewShape, type ShapeKind, type ShapeOptions } from './shapes';\nexport { meshEdges, weldVertices, type EdgeOptions } from './edges';\nexport { addLayer, bakedIndex, duplicateLayer, editLayer, editRecipe, History, kindHint, layerCount, locate, moveLayer, moveLayerStep, removeLayer, type LayerPlace } from './stack';\nexport { exportMaps, recipeJson, zipFiles, type ExportFile, type ExportOptions } from './export';\nexport { crc32, encodePng, fileStem, zipStore, type PngImage } from './files';\nexport * from './saved';\nexport { presetCode, presetKey, type PresetCode } from './preset-code';\nexport { disposeMaterials, DoorMaterial, GpuDoorBackend, material, MATERIAL_STYLES, MaterialDoor, materialDoor, setMaterialRenderer, setMaterialStyle, type BakeTiming, type DoorBackend, type DoorMaps, type DoorOptions, type MapsEntry, type MaterialOptions, type MaterialStyle, type OutlineMode, } from './door';\nexport { MATERIAL_NAMES, MATERIAL_PRESETS, type FlatNumbers, type MaterialGroup, type MaterialName, type MaterialPreset } from './door-presets';"
        }
      ],
      "pitfalls": [
        "The front door’s realistic bake is asynchronous",
        "The style switch puts the style’s nodes on every material the door made",
        "The door’s realistic style reads the maps flat",
        "Each preset and size the door bakes keeps its maps",
        "Flat and painterly glass (frosted glass) blends by opacity",
        "A layer writes its colour, roughness, metalness and glow wherever it applies",
        "A mask is 0 below `from` and above `to`, rising over `soft` above `from`",
        "A layer above that mixes colour (or roughness, metalness, glow) at full amount under a wide…",
        "A cavity mask reads crevices a few texels across (the height’s local average minus itself)",
        "`gridFrom` follows every tile pattern",
        "Per-shape values come from a cell channel, not a flood fill",
        "Height blend `detail` bends only the normal map",
        "An image layer keeps its picture in the recipe as a data URL of at most MAX_IMAGE_CHARS",
        "Some new passes cost more than the first set",
        "The audit (`auditRecipe`) bakes once for each probe",
        "Every field is periodic over the tile",
        "Parallax occlusion moves the texture, not the silhouette",
        "Parallax works with UV projection only",
        "Displacement by UV cracks along UV seams (the two sides read different texels)",
        "The material needs tangents for the best parallax and anisotropy",
        "Worn edges read a per-vertex `edge` attribute",
        "Base values (clearcoat, sheen, specular, ior, emissive, scattering…), the relief mode",
        "The bake writes 16-bit state targets of three textures each",
        "Base colour is stored as its square root in 8 bits (so dark colours keep their steps)",
        "A material layer bakes into the same maps, so most values become per texel",
        "Material layers do not nest (one inside another is dropped by validateRecipe)",
        "Hex tiling reads every map three times",
        "Live effects (recipe.live: flow, wet, rain, snow, the dissolve) are worked out as the material…",
        "The live clock (flow, the glow’s pulse, rain) runs once a frame while RecipeMaterial.motion is…",
        "A dissolve cuts the surface with the material’s mask, which three also uses for its shadow pass",
        "Your own model in the demo",
        "Parallax shadows and scattering run in the material’s own lighting model",
        "Scattering is an approximation from the surface",
        "The height is clamped to 0..1 when the maps are made",
        "Shaders compile on first draw",
        "Changing the projection (UV, triplanar, object or world space) rebuilds the material’s shader",
        "bakeStats.ms waits for the GPU (the queue is drained first, then the bake, then waited on)",
        "A UV sphere pinches at its poles",
        "The WebGL 2 fallback works",
        "Transmission (glass, ice) refracts what is behind the object",
        "Cells’ f1 is a cone round each point",
        "Foliage under displacement",
        "Exported maps are flipped to the image convention",
        "A Fn with a layout (hashCell, gradientNoise) called with a plain number as an argument makes…",
        "Car paint shows where the stack leaves the base colour, judged per texel from the albedo map",
        "Saved materials live in this browser’s localStorage",
        "A saved material’s thumbnail is made when it is saved, by the gallery’s swatch renderer"
      ],
      "card": "entries/material-designer.json"
    },
    {
      "id": "meadow-grass",
      "aliases": [],
      "name": "GPU meadow grass",
      "summary": "Hundreds of thousands of curved blades decided on the GPU every frame: spots hashed from a density field, culled and sorted into three detail lists drawn with indirect draws, gusting wind, and trampled paths that linger and spring back. Paths walked again and again wear to bare earth and grow back slowly, and fixed things keep the grass off their footprints. Loose stones are placed the same way (hashed spots kept by a field of your ground, culled, every kind of stone in one indirect draw), so pebbles show where a path has worn to earth or a gravel spill lies, and a soft contact shade sits under a body and fades as it rises.",
      "category": "surface",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "balanced",
      "tags": [
        "grass",
        "compute",
        "indirect draw",
        "lod",
        "wind",
        "trampling",
        "alpha to coverage",
        "tsl",
        "wear",
        "footprints",
        "bare ground",
        "loose stones",
        "gravel",
        "scatter",
        "contact shadow",
        "blob shadow",
        "render-target placement",
        "webgl fallback"
      ],
      "useCases": [
        "open-world fields and lawns",
        "paths that characters and vehicles leave",
        "wind you can see",
        "stylised or realistic landscapes",
        "hero shots of nature",
        "worn paths across a lawn or a field",
        "no grass through crates, walls and posts",
        "pebbles and gravel on paths, tracks and yards",
        "grounding characters and props without a shadow map"
      ],
      "interaction": "Shift-drag across the grass to trample and wear it · drag to orbit · try Loose stones and Contact shade",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "heightfield-chunks",
          "why": "The ground the blades grow on"
        },
        {
          "id": "brush-through",
          "why": "Plants that part beside the trampled paths"
        },
        {
          "id": "cloud-shadows",
          "why": "Cloud shade over the meadow"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "No soft blade edges, the grass reaching 72 m (not 80) and the curved blades ending nearer.",
          "low": "Mobile density (69 a m²), no soft blade edges, the grass reaching 64 m and the curved blades ending nearer."
        },
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.80",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-03",
          "gpuMs": 1.44,
          "cpuMs": 0.28,
          "cpuP95Ms": 0.415,
          "badge": "moderate",
          "drawCalls": 4,
          "computeDispatches": 4,
          "frames": null,
          "notes": "Balanced density over an 80 m square round the focus (the game’s default), the ball rolling, wind 1: one placement compute pass and three indirect draws."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 20.84,
          "cpuMs": 0.895,
          "cpuP95Ms": 1.785,
          "badge": "heavy",
          "drawCalls": 14,
          "computeDispatches": 5,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 531 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 3.347,
          "cpuMs": 0.1,
          "cpuP95Ms": 0.18,
          "badge": "heavy",
          "drawCalls": 14,
          "computeDispatches": 5,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 1454 ms."
        }
      ],
      "signatures": [
        {
          "file": "contact-shade.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\nexport declare const CONTACT_SHADE_OPACITY = 0.52;\nexport declare const CONTACT_FADE_HEIGHT = 8;\nexport declare function contactFade(height: number, fadeHeight?: number): number;\nexport type ContactShadeOptions = {\n    colour?: THREE.ColorRepresentation;\n    opacity?: number;\n    instanced?: boolean;\n    fade?: Node<'float'>;\n};\nexport declare function contactShadeMaterial(options?: ContactShadeOptions): THREE.MeshBasicNodeMaterial;\nexport declare function contactShade(width: number, depth: number, options?: Omit<ContactShadeOptions, 'fade' | 'instanced'>): {\n    mesh: THREE.Mesh<THREE.PlaneGeometry, THREE.MeshBasicNodeMaterial, THREE.Object3DEventMap>;\n    place(x: number, z: number, heightAt: (x: number, z: number) => number, over: number, yaw?: number, fadeHeight?: number): void;\n    dispose(): void;\n};"
        },
        {
          "file": "footprints.ts",
          "declarations": "export interface Footprint {\n    minX: number;\n    maxX: number;\n    minZ: number;\n    maxZ: number;\n    polygon: Float64Array | null;\n    circle: [\n        number,\n        number,\n        number\n    ] | null;\n}\nexport declare const GAP = 0.35;\nexport type Vec3 = [\n    number,\n    number,\n    number\n];\nexport type Quat = [\n    number,\n    number,\n    number,\n    number\n];\nexport type FootprintShape = {\n    kind: 'box';\n    centre: Vec3;\n    half: Vec3;\n    rotation?: Quat;\n} | {\n    kind: 'cylinder' | 'cone' | 'capsule';\n    centre: Vec3;\n    radius: number;\n    halfHeight: number;\n} | {\n    kind: 'ball';\n    centre: Vec3;\n    radius: number;\n} | {\n    kind: 'points';\n    centre: Vec3;\n    points: ArrayLike<number>;\n    rotation?: Quat;\n};\nexport declare function hull(xs: number[], zs: number[]): Float64Array<ArrayBuffer>;\nexport declare function footprintOf(shape: FootprintShape, heightAt: (x: number, z: number) => number, gap?: number): Footprint | null;\nexport declare function rasterise(footprints: readonly Footprint[], originX: number, originZ: number, cell: number, resolution: number): Uint8Array<ArrayBuffer>;\nexport declare function changedCells(before: Uint8Array, after: Uint8Array): number[];"
        },
        {
          "file": "inputs.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\nexport declare const MEADOW_LAYERS = 4;\nexport type MeadowField = {\n    originX: number;\n    originZ: number;\n    resolution: number;\n    cell: number;\n    density: Uint8Array;\n    height: Float32Array;\n};\nexport type VegetationLayer = {\n    grass: {\n        colorLow: string;\n        colorHigh: string;\n        lowHeight: number;\n        highHeight: number;\n        bladeWidth: number;\n    };\n    response: {\n        wind: number;\n        recoverySeconds: number;\n    };\n};\nexport declare const GRASS: Record<'pasture' | 'meadow' | 'dry' | 'lush', VegetationLayer>;\nexport declare function bakeField(centreX: number, centreZ: number, heightAt: (x: number, z: number) => number, densityAt: (x: number, z: number) => [\n    number,\n    number,\n    number,\n    number\n], size?: number, cell?: number): MeadowField;\nexport declare const RELIEF: {\n    light: number;\n};\nexport declare const reliefLight: THREE.UniformNode<\"float\", number>;\nexport declare const snowUniforms: {\n    grass: THREE.UniformNode<\"vec2\", THREE.Vector2>;\n};\nexport declare const snowColour: () => Node<\"vec3\">;\nexport declare function setFogPosition(_material: THREE.Material, _position: Node<'vec3'>): void;\nexport declare function laidEarth(field: Node<'vec4'>, at?: Node<'vec2'>): Node<\"float\">;"
        },
        {
          "file": "loose-stones.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\ntype F = Node<'float'>;\ntype V2 = Node<'vec2'>;\nexport type LooseSettings = {\n    spacing: number;\n    area: number;\n    fadeNear: number;\n    fadeFar: number;\n    capacity: number;\n};\nexport declare const LOOSE: LooseSettings;\nexport declare function pieceTriangles(geometries: readonly THREE.BufferGeometry[]): {\n    vertices: number;\n    positions: Float32Array<ArrayBuffer>;\n    normals: Float32Array<ArrayBuffer>;\n    blues: Float32Array<ArrayBuffer>;\n};\nexport declare function stonePieces(count?: number, seed?: number): THREE.BufferGeometry[];\nexport declare function looseStonesRun(renderer: THREE.WebGPURenderer): boolean;\nexport type LooseStonesOptions = Partial<LooseSettings> & {\n    scale?: number;\n};\nexport declare class LooseStones {\n    readonly object3D: THREE.Group<THREE.Object3DEventMap>;\n    readonly settings: LooseSettings;\n    enabled: boolean;\n    constructor(pieces: readonly THREE.BufferGeometry[], keepAt: (xz: V2) => F, groundHeight: (xz: V2) => F, options?: LooseStonesOptions);\n    setScale(scale: number): void;\n    update(renderer: THREE.WebGPURenderer, camera: THREE.Camera, focus: {\n        x: number;\n        z: number;\n    }): void;\n    warm(renderer: THREE.WebGPURenderer): Promise<void>;\n    dispose(): void;\n}\nexport {};"
        },
        {
          "file": "meadow.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\nimport { type MeadowField } from './inputs';\nimport type { VegetationLayer } from './inputs';\ntype F = Node<'float'>;\ntype V2 = Node<'vec2'>;\ntype V3 = Node<'vec3'>;\nexport declare const MEADOW_LODS: readonly [\n    {\n        readonly segments: 4;\n        readonly until: 9;\n        readonly capacity: 65536;\n    },\n    {\n        readonly segments: 2;\n        readonly until: 22;\n        readonly capacity: 393216;\n    },\n    {\n        readonly segments: 1;\n        readonly until: number;\n        readonly capacity: 393216;\n    }\n];\nexport type MeadowTier = 'high' | 'medium' | 'low';\nexport type MeadowLod = {\n    segments: number;\n    until: number;\n    capacity: number;\n};\nexport declare const MEADOW_TIER_LODS: Record<MeadowTier, readonly [\n    number,\n    number\n]>;\nexport declare function meadowLods(tier?: MeadowTier): readonly MeadowLod[];\nexport declare const MEADOW_TIERS: Record<MeadowTier, {\n    spacing: number;\n    area: number;\n    fadeNear: number;\n    fadeFar: number;\n    softEdges: boolean;\n}>;\nexport declare const MAX_WALKERS = 48;\nexport declare const MEADOW_FIELD_RESOLUTION = 192;\nexport declare const FIRE_TEXELS = 128;\nexport declare const FIRE_CELL = 0.5;\nexport type MeadowSettings = {\n    spacing: number;\n    area: number;\n    fadeNear: number;\n    fadeFar: number;\n    shadows: boolean;\n    softEdges?: boolean;\n    tier?: MeadowTier;\n    lods?: readonly MeadowLod[];\n    webgl?: boolean;\n};\nexport declare function meadowOnGpu(renderer: THREE.WebGPURenderer): boolean;\nexport declare function meadowRunsOnWebGL(renderer: THREE.WebGPURenderer): boolean;\nexport type Walker = {\n    x: number;\n    z: number;\n    radius: number;\n    strength: number;\n};\nexport declare const MEADOW_WIND: {\n    readonly x: 0.8;\n    readonly z: 0.35;\n};\nexport declare class Meadow {\n    readonly object3D: THREE.Group<THREE.Object3DEventMap>;\n    readonly settings: MeadowSettings;\n    readonly spots: number;\n    setPixelsPerMetre(pixelsPerMetre: number): void;\n    readonly lods: readonly MeadowLod[];\n    constructor(settings: MeadowSettings, groundPressure?: (xz: Node<'vec2'>) => Node<'vec4'>);\n    groundHeight(xz: V2): F;\n    get timeNode(): F;\n    get gustState(): {\n        time: number;\n        travel: THREE.Vector2;\n    } | undefined;\n    get windNode(): V2;\n    trampleAt(xz: V2): V2;\n    setTrample(share: number): void;\n    leanAt(xz: V2): V3;\n    leanNear(xz: V2, margin: F): THREE.Node<\"bool\">;\n    setLayers(layers: readonly (VegetationLayer | null)[]): void;\n    setFire(texels: Uint8Array, x: number, z: number): void;\n    setField(field: MeadowField): void;\n    setDensity(density: Uint8Array): void;\n    setLighting(toSun: THREE.Vector3, sunColor: THREE.Color, ambient: THREE.Color): void;\n    update(renderer: THREE.WebGPURenderer, dt: number, camera: THREE.Camera, focus: {\n        x: number;\n        z: number;\n    }, walkers: readonly Walker[], wind?: {\n        x: number;\n        z: number;\n    }): void;\n    warm(renderer: THREE.WebGPURenderer): Promise<void>;\n    dispose(): void;\n}\nexport {};"
        },
        {
          "file": "wear.ts",
          "declarations": "export type WearGrid = {\n    originX: number;\n    originZ: number;\n    resolution: number;\n    cell: number;\n};\nexport type WearSettings = {\n    wearSeconds: number;\n    recoverSeconds: number;\n    interval: number;\n};\nexport type Presser = {\n    x: number;\n    z: number;\n    radius: number;\n    strength: number;\n};\nexport declare const WEAR_DEFAULTS: WearSettings;\nexport declare function grassLeft(wear: number): number;\nexport declare class WearField {\n    readonly settings: WearSettings;\n    readonly wear: Float32Array;\n    constructor(grid: WearGrid, settings?: Partial<WearSettings>);\n    get wornCells(): number;\n    step(dt: number, walkers: readonly Presser[]): boolean;\n    compose(base: Uint8Array, mask: Uint8Array | null, out?: Uint8Array): Uint8Array;\n    bytes(out?: Uint8Array): Uint8Array;\n    clear(): void;\n    recentre(originX: number, originZ: number): void;\n}"
        }
      ],
      "pitfalls": [
        "Work a blade out once in compute (placement, culling, LOD list), not per vertex",
        "Blades under a pixel wide cost far more to draw than wider ones and flicker as single bright…",
        "Light blades by hand (sun + sky, a little light through the tips) instead of a PBR light loop",
        "The gusts’ pattern must travel by the wind summed frame by frame, not wind × clock",
        "Soft edges need the canvas’s MSAA (antialias: true) for alpha to coverage",
        "The density field is 192 cells a side (96 m at 0.5 m)",
        "Measure uncapped: at a frame cap the GPU drops its clocks and the timer swings by ±2 ms",
        "Keep grass off fixed things by rasterising their footprints into the field",
        "Wear and trampling are different clocks",
        "A new density is a 147 KB upload",
        "Draw every kind of loose stone in one indirect draw",
        "Store nothing per stone: hash a spot’s cell for its jitter, piece, size, turn, tilt and tint",
        "Draw loose stones larger than real (1.6–2.4 ×)",
        "On an integrated GPU, cut blades, not effects",
        "A contact shade is see-through, writes no depth and is pulled toward the camera (polygon offset)",
        "Without WebGPU, set `webgl: !meadowOnGpu(renderer)`"
      ],
      "card": "entries/meadow-grass.json"
    },
    {
      "id": "mech-walkers",
      "aliases": [],
      "name": "Mech walkers",
      "summary": "Legged machines that walk from code: a radial walker on any number of legs and a two-legged strider on reverse-jointed legs. Each leg solves in closed form (hip yaw, then a two-bone triangle in the leg’s plane); gaits are groups of legs stepped in turn (diagonal pairs, tripods, a wave, a crawl); each step is planned clear of walls and of the leg’s own thigh and shin, over the highest thing it passes, with fallbacks and footholds on walls. The body rides a heavy spring that sags onto each landing and leans with the plane through its feet. It turns on the spot, moves sideways, rears up, regroups when a leg is lost, and leaps. Footfalls throw dust, thud and shake the camera by weight. Four builds; the meshes hang on named pivots, so a GLB with those names walks the same way.",
      "category": "simulation",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "balanced",
      "tags": [
        "mech",
        "robot",
        "walker",
        "legged locomotion",
        "procedural animation",
        "inverse kinematics",
        "two-bone ik",
        "closed form",
        "gait",
        "tripod gait",
        "wave gait",
        "biped",
        "digitigrade",
        "reverse joint",
        "foot placement",
        "step planning",
        "wall climbing",
        "spring",
        "footfalls",
        "camera shake",
        "dust",
        "web audio",
        "named pivots",
        "gltf",
        "three.js",
        "no dependencies"
      ],
      "useCases": [
        "walking machines, spiders and crawlers in a game, on uneven ground and among boxes and walls",
        "a heavy two-legged machine whose every step is felt",
        "a vehicle a player drives with W A S D, sideways and turning on the spot",
        "damage that takes a leg out and changes how a machine walks",
        "a GLB rigged with named empties, driven without animation clips",
        "footstep dust, thuds and screen shake scaled by weight and distance"
      ],
      "interaction": "W A S D move · Q E turn · tap the ground to walk there · 1–4 builds · take a leg out in the dock",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "ring-effects",
          "why": "Dust and marks at each footfall"
        },
        {
          "id": "game-cameras",
          "why": "Cameras that follow a walker"
        },
        {
          "id": "heightfield-chunks",
          "why": "Ground the legs find footholds on"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "shake",
          "in": "demo",
          "values": {
            "strict": false,
            "playful": true
          },
          "note": "camera shake on each landing"
        },
        {
          "name": "sound",
          "in": "demo",
          "values": {
            "strict": false,
            "playful": true
          }
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-13",
          "gpuMs": 0.635,
          "cpuMs": 0.995,
          "cpuP95Ms": 1.33,
          "badge": "moderate",
          "drawCalls": 89,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured wandering by itself over the 4° bumpy lab in the default build (the six-legged hauler, its tripod gait): one rig stepped at 60 Hz with its step planning and ray queries, the pose put on 39 meshes (one per pivot, every part merged into it) through the named pivots, dust from each landing in one instanced draw, and a shadowed sun. Standing still with no dust in the air, nothing is drawn."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 2.687,
          "cpuMs": 1.595,
          "cpuP95Ms": 2.325,
          "badge": "heavy",
          "drawCalls": 89,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 332 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 2.062,
          "cpuMs": 0.42,
          "cpuP95Ms": 0.62,
          "badge": "heavy",
          "drawCalls": 88,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 913 ms."
        }
      ],
      "signatures": [
        {
          "file": "biped-rig.ts",
          "declarations": "import { type LegSolve, type Pose, type Vec3, type WalkerCommand, type WalkerFrame, type WalkerWorld } from './walker-rig';\nexport declare const dirOf: (bearing: number) => Vec3;\nexport declare function ballOf(leg: BipedLeg, contact: Vec3, heading: number, normal?: Vec3): Vec3;\nexport type BipedLeg = {\n    hip: Vec3;\n    rollAt: Vec3;\n    bearing: number;\n    coxaU: number;\n    coxaW: number;\n    thigh: number;\n    shin: number;\n    meta: number;\n    thighRest: number;\n    shinRest: number;\n    bend: number;\n    ball: Vec3;\n    home: Vec3;\n    toeAhead: number;\n    toeUp: number;\n    reachMax: number;\n    reachMin: number;\n};\nexport type BipedLegPoints = {\n    hip: Vec3;\n    roll: Vec3;\n    thigh: Vec3;\n    knee: Vec3;\n    ankle: Vec3;\n    ball: Vec3;\n    foot: Vec3;\n};\nexport declare function readBipedLeg(p: BipedLegPoints): BipedLeg;\nexport type BipedLegSolve = LegSolve & {\n    roll: number;\n    ankle: number;\n    ankleAt: Vec3;\n    ballAt: Vec3;\n};\nexport declare function solveBipedLeg(leg: BipedLeg, ball: Vec3, heading?: number, yawLimit?: number, rollLimit?: number): BipedLegSolve;\nexport type BipedGait = {\n    name: string;\n    shiftTime: number;\n    stepTime: number;\n    stepHeight: number;\n    stride: number;\n    sway: number;\n    lean: number;\n    bob: number;\n    twist: number;\n    speed: number;\n    side: number;\n    back: number;\n    turn: number;\n    turnStep: number;\n};\nexport type BipedSpec = {\n    legs: BipedLeg[];\n    restHeight: number;\n    heightRange: [\n        number,\n        number\n    ];\n    gaits: Record<string, BipedGait>;\n    maxTilt: number;\n    stepUp: number;\n    stepOver?: number;\n    yawLimit: number;\n    rollLimit: number;\n    footRadius?: number;\n    bodyRadius?: number;\n    sag?: number;\n};\nexport type BipedCommand = WalkerCommand & {\n    stomp?: boolean;\n};\nexport type BipedPhase = 'stand' | 'shift' | 'swing';\nexport type BipedFrame = Omit<WalkerFrame, 'legs'> & {\n    legs: Array<WalkerFrame['legs'][number] & {\n        solve: BipedLegSolve;\n        heading: number;\n        normal: Vec3;\n    }>;\n    phase: BipedPhase;\n    swing: number;\n    twist: number;\n    sway: number;\n    stomped: number;\n};\nexport declare class Strider {\n    readonly spec: BipedSpec;\n    readonly world: WalkerWorld;\n    pose: Pose;\n    collapsed: boolean;\n    constructor(spec: BipedSpec, world: WalkerWorld, at: Vec3, yaw?: number);\n    setDead(leg: number, dead: boolean): void;\n    isDead(leg: number): boolean;\n    stagger(push: Vec3): void;\n    step(dt: number, command: BipedCommand): BipedFrame;\n    footAt(leg: number): {\n        x: number;\n        y: number;\n        z: number;\n    };\n    footHeading(leg: number): number;\n    footTarget(leg: number): Vec3 | null;\n}"
        },
        {
          "file": "footfall-fx.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { FootfallHost } from './footfalls';\nexport type FootfallFxOptions = {\n    capacity?: number;\n};\nexport declare function createFootfallFx(scene: THREE.Scene, options?: FootfallFxOptions): {\n    host: FootfallHost;\n    set(o: {\n        dust?: boolean;\n        shake?: boolean;\n        reduced?: boolean;\n    }): void;\n    setSound(on: boolean): boolean;\n    update(dt: number): boolean;\n    shake(out: THREE.Vector3): THREE.Vector3;\n    warm(on: boolean): void;\n    clear(): void;\n    readonly alive: number;\n    dispose(): void;\n};\nexport type FootfallFx = ReturnType<typeof createFootfallFx>;"
        },
        {
          "file": "footfalls.ts",
          "declarations": "import type { Vec3, WalkerFrame } from './walker-rig';\nexport type Heft = {\n    dust: number;\n    dustSize: number;\n    dustSpeed: number;\n    thud: number;\n    pitch: number;\n    shake: number;\n    near: number;\n    far: number;\n};\nexport declare const HEFT: Record<'scout' | 'hauler' | 'leaper' | 'strider', Heft>;\nexport declare function feltAt(distance: number, heft: Pick<Heft, 'near' | 'far'>): number;\nexport type Puff = {\n    at: Vec3;\n    velocity: Vec3;\n    size: number;\n    grow: number;\n    life: number;\n    opacity: number;\n};\nexport type Footfall = {\n    leg: number;\n    at: Vec3;\n    puffs: Puff[];\n    thud: {\n        gain: number;\n        pitch: number;\n        pan: number;\n        metal: boolean;\n    };\n    shake: number;\n};\nexport declare function footfall(leg: number, at: Vec3, onWall: boolean, heft: Heft, listener: Vec3, right: Vec3, random?: () => number): Footfall;\nexport type FootfallHost = {\n    puff(at: Vec3, velocity: Vec3, style: {\n        size: number;\n        grow: number;\n        life: number;\n        color: string;\n        opacity: number;\n        drag: number;\n        rise: number;\n    }): void;\n    thud(gain: number, pitch: number, pan: number, metal: boolean): void;\n    kick(amount: number): void;\n};\nexport declare const DUST: string[];\nexport declare function feelSteps(frame: Pick<WalkerFrame, 'landed' | 'legs'>, heft: Heft, listener: Vec3, right: Vec3, host: FootfallHost, options?: {\n    random?: () => number;\n    dust?: readonly string[];\n}): void;"
        },
        {
          "file": "lab-world.ts",
          "declarations": "import type { WalkerWorld } from './walker-rig';\nexport type LabBox = {\n    x: number;\n    z: number;\n    w: number;\n    d: number;\n    h: number;\n};\nexport declare function labWorld(slope: number, bumps: number, boxes: readonly LabBox[]): WalkerWorld & {\n    height(x: number, z: number): number;\n    base(b: LabBox): number;\n};"
        },
        {
          "file": "mechs.ts",
          "declarations": "import { type Vec3, type WalkerSpec } from './walker-rig';\nimport { type BipedLegPoints, type BipedSpec } from './biped-rig';\nexport type RadialBuild = {\n    kind: 'radial';\n    id: string;\n    name: string;\n    spec: WalkerSpec;\n    body: {\n        size: Vec3;\n        head: Vec3;\n        headAt: Vec3;\n    };\n    points: Array<{\n        hip: Vec3;\n        thigh: Vec3;\n        knee: Vec3;\n        foot: Vec3;\n    }>;\n    move: {\n        speed: Record<string, number>;\n        turn: number;\n    };\n};\nexport type BipedBuild = {\n    kind: 'biped';\n    id: string;\n    name: string;\n    spec: BipedSpec;\n    body: {\n        pelvis: Vec3;\n        torso: Vec3;\n        torsoAt: Vec3;\n        ring: Vec3;\n    };\n    points: BipedLegPoints[];\n    move: {\n        speed: Record<string, number>;\n        turn: number;\n    };\n};\nexport type MechBuild = RadialBuild | BipedBuild;\nexport declare function legPoints(hip: Vec3, foot: Vec3, coxa: number, thigh: number, shin: number): {\n    hip: Vec3;\n    thigh: Vec3;\n    knee: Vec3;\n    foot: Vec3;\n};\nexport declare function scout(): RadialBuild;\nexport declare function hauler(): RadialBuild;\nexport declare function leaper(): RadialBuild;\nexport declare function strider(): BipedBuild;\nexport declare const MECHS: readonly [\n    {\n        readonly id: \"scout\";\n        readonly label: \"Scout\";\n        readonly legs: 4;\n        readonly make: typeof scout;\n        readonly hint: \"Light, four legs: walks any way in diagonal pairs, crawls a foot onto a wall.\";\n    },\n    {\n        readonly id: \"hauler\";\n        readonly label: \"Hauler\";\n        readonly legs: 6;\n        readonly make: typeof hauler;\n        readonly hint: \"Heavy, six legs: a slow wave or tripods; rears onto its back pair.\";\n    },\n    {\n        readonly id: \"leaper\";\n        readonly label: \"Leaper\";\n        readonly legs: 4;\n        readonly make: typeof leaper;\n        readonly hint: \"Quick, four long legs: trots, bounds, rears and leaps up to 7 m.\";\n    },\n    {\n        readonly id: \"strider\";\n        readonly label: \"Strider\";\n        readonly legs: 2;\n        readonly make: typeof strider;\n        readonly hint: \"Two reverse-jointed legs: shifts its weight, slams each foot down, turns in steps.\";\n    }\n];\nexport type MechId = (typeof MECHS)[number]['id'];"
        },
        {
          "file": "robot-model.ts",
          "declarations": "import { Object3D, Vector3 } from 'three';\nimport { type Leg, type WalkerFrame } from './walker-rig';\nimport { type BipedLeg } from './biped-rig';\nimport type { MechBuild } from './mechs';\nexport type RobotModel = {\n    root: Object3D;\n    body: Object3D;\n    restHeight: number;\n    legs: Array<{\n        leg: Leg;\n        hip: Object3D;\n        thigh: Object3D;\n        shin: Object3D;\n        ankle: Object3D | null;\n        hinge: Vector3;\n    }>;\n    head: {\n        yaw: Object3D;\n        pitch: Object3D | null;\n    } | null;\n    torso: Object3D | null;\n    rams: Array<{\n        a: Object3D;\n        b: Object3D;\n        restA: Vector3;\n        restB: Vector3;\n    }>;\n    bipedLegs?: Array<{\n        leg: BipedLeg;\n        hip: Object3D;\n        roll: Object3D;\n        thigh: Object3D;\n        shin: Object3D;\n        ankle: Object3D;\n        foot: Object3D;\n        hinge: Vector3;\n        rollAxis: Vector3;\n    }>;\n};\nexport declare function robotModelIssues(root: Object3D): string[];\nexport declare function readRobotModel(root: Object3D): RobotModel;\nexport type LookPose = {\n    yaw?: number;\n    pitch?: number;\n    torso?: number;\n};\nexport declare function poseRobot(model: RobotModel, frame: WalkerFrame, look?: LookPose): void;\nexport declare function buildPivots(build: MechBuild, options?: {\n    ankles?: boolean;\n}): Object3D;"
        },
        {
          "file": "walker-rig.ts",
          "declarations": "export type Vec3 = {\n    x: number;\n    y: number;\n    z: number;\n};\nexport declare const bearingOf: (d: Vec3) => number;\nexport type Pose = {\n    position: Vec3;\n    yaw: number;\n    pitch: number;\n    roll: number;\n};\nexport declare const toWorld: (p: Pose, a: Vec3) => Vec3;\nexport declare const toBody: (p: Pose, a: Vec3) => Vec3;\nexport type Leg = {\n    hip: Vec3;\n    coxa: number;\n    coxaRise: number;\n    thigh: number;\n    shin: number;\n    home: Vec3;\n    bearing: number;\n    thighRest: number;\n    kneeRest: number;\n    reachMax: number;\n    reachMin: number;\n};\nexport declare function readLeg(hip: Vec3, thigh: Vec3, knee: Vec3, foot: Vec3): Leg;\nexport type LegSolve = {\n    hipYaw: number;\n    thigh: number;\n    knee: number;\n    kneeAt: Vec3;\n    reached: boolean;\n};\nexport declare function solveLeg(leg: Leg, foot: Vec3, yawLimit?: number): LegSolve;\nexport type Gait = {\n    name: string;\n    groups: number[][];\n    stepTime: number;\n    stepHeight: number;\n    wallFeet: number;\n    ride?: number;\n    bounce?: number;\n    rock?: number;\n};\nexport type LeapSpec = {\n    crouch: number;\n    distance: number;\n    speed: number;\n    clear: number;\n    drop: number;\n    tuck: number;\n    land: number;\n};\nexport type WalkerSpec = {\n    legs: Leg[];\n    restHeight: number;\n    heightRange: [\n        number,\n        number\n    ];\n    gaits: Record<string, Gait>;\n    maxTilt: number;\n    rear?: {\n        on: number[];\n        arms: number[];\n        pitch: number;\n        lift: number;\n        armAt: Vec3[];\n        rise?: number;\n        fall?: number;\n    };\n    leap?: LeapSpec;\n    spring?: typeof RIDE;\n    stepUp: number;\n    stepOver?: number;\n    yawLimit: number;\n    footRadius?: number;\n    bodyRadius?: number;\n    belly?: number;\n    bellyRadius?: number;\n};\nexport interface WalkerWorld {\n    groundAt(x: number, z: number, fromY: number): {\n        y: number;\n        normal: Vec3;\n    } | null;\n    ray(from: Vec3, dir: Vec3, max: number): {\n        point: Vec3;\n        normal: Vec3;\n    } | null;\n}\nexport type WalkerCommand = {\n    velocity: Vec3;\n    turn: number;\n    gait: string;\n    height?: number;\n    rear?: number;\n};\nexport type WalkerFrame = {\n    pose: Pose;\n    legs: Array<{\n        solve: LegSolve;\n        foot: Vec3;\n        planted: boolean;\n        onWall: boolean;\n        dead: boolean;\n        arm: boolean;\n    }>;\n    collapsed: boolean;\n    landed: number[];\n    leap?: 'crouch' | 'flight';\n};\ndeclare const RIDE: {\n    stiffness: number;\n    damping: number;\n    sag: number;\n    tiltRate: number;\n};\nexport declare class Walker {\n    readonly spec: WalkerSpec;\n    readonly world: WalkerWorld;\n    pose: Pose;\n    collapsed: boolean;\n    constructor(spec: WalkerSpec, world: WalkerWorld, at: Vec3, yaw?: number);\n    setDead(leg: number, dead: boolean): void;\n    isDead(leg: number): boolean;\n    step(dt: number, command: WalkerCommand): WalkerFrame;\n    get leapingNow(): boolean;\n    leap(to: Vec3): boolean;\n    footAt(leg: number): {\n        x: number;\n        y: number;\n        z: number;\n    };\n    footTarget(leg: number): Vec3 | null;\n}\nexport declare const RIG_STEP: number;\nexport declare function substep<F extends {\n    landed: number[];\n    stomped?: number;\n}>(dt: number, one: (h: number, first: boolean) => F): F;\nexport {};"
        }
      ],
      "pitfalls": [
        "The rigs were tuned and tested at 60 Hz",
        "Feet are world points and the body is placed in the model root’s frame",
        "The world adapter decides everything a foot may do",
        "The rig asks a lot of rays when a group lifts",
        "Look for the tallest thing under a swing from well above the body",
        "A body pushed against a wall drags its legs through it unless it stops short",
        "A foot may go on a wall only while two other feet stand on walkable ground and the gait allows…",
        "Dead legs turn any gait into a one-foot-at-a-time crawl",
        "A leap is refused, with nothing done, when it is too far, over something taller than `clear`",
        "The biped turns only as fast as a planted foot’s hip yaw and roll allow, then steps round",
        "Pivots are unrotated at rest (bake rotations into the meshes under them)",
        "The poser levels each radial ankle and each biped’s toes against the root’s turn every frame",
        "Sound starts only from a click or a key (the browser’s rule)"
      ],
      "card": "entries/mech-walkers.json"
    },
    {
      "id": "meeting-scheduler",
      "aliases": [],
      "name": "Meeting scheduler: a year across time zones",
      "summary": "A pure, tested scheduling core for a team spread over offices and time zones. Time is kept in half-hour UTC slots; each office’s clock comes from Intl, so daylight saving changes at the right slot of the right week (Europe and North America change on different Sundays, the southern hemisphere the other way, half-hour zones line up). Every person has a year of calendar (working hours, the early and late hours they will stretch to, days off, leave, trips, fixed and movable meetings, holds), generated from a seed or loaded from real busy times. evaluate() gives a slot’s cost with a reason per person; find() ranks slots; issues() lists clashes and advise() a fix for each (a better slot, asking someone to move a meeting, a stand-in, making someone optional). Series are linked by rules such as “5 to 12 days after the one before”: ripple() shows what follows when one moves, repair() mends broken rules and solve() re-places the year. Invites are RFC 5545 .ics with METHOD:REQUEST, quoted parameters and lines folded at 75 octets, downloadable through a data: URL a strict CSP allows. The demo lays a team’s year out as lanes you drag, with threads between linked meetings and a beam through every office’s day.",
      "category": "data",
      "role": "system",
      "stack": [
        "headless"
      ],
      "character": "calm",
      "tags": [
        "scheduling",
        "calendar",
        "meetings",
        "time zones",
        "intl",
        "daylight saving",
        "utc",
        "constraints",
        "linked series",
        "ripple",
        "repair",
        "solver",
        "ranking",
        "explanations",
        "clashes",
        "quorum",
        "icalendar",
        "ics",
        "rfc 5545",
        "invites",
        "drag",
        "keyboard",
        "live region",
        "seeded",
        "pure",
        "no dependencies"
      ],
      "useCases": [
        "finding a meeting time for people in several time zones, with the reason each slot costs what it does",
        "planning a year of recurring meetings that depend on each other (a review after the numbers, a town hall after the review)",
        "showing what else has to move when one meeting moves, before anyone commits",
        "a clash list where every problem comes with a fix that can be applied in one click",
        "writing calendar invites that every client accepts, from any planner or booking tool",
        "testing time-zone code against real clock changes without a date library"
      ],
      "interaction": "Pick a meeting for its ranked slots · drag one along its lane and watch the linked ones follow · apply a fix · Re-place the year",
      "kits": [],
      "pairsWith": [
        {
          "id": "date-picker",
          "why": "Pick the range to schedule in"
        },
        {
          "id": "intent-bar",
          "why": "Book from a typed sentence"
        },
        {
          "id": "jelly-marks",
          "why": "Bookings that feel like things in a month view"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 1.39,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.288,
            "p99Ms": 18.005,
            "low1Fps": 55.4
          },
          "notes": "Measured with the demo driving itself from its first frame: every eighth frame it drags the March monthly numbers a day further (a find for the day and a ripple through the rules, then the loom, threads and windows redrawn), and every 48 frames it picks the next meeting (six ranked slots with their reasons, each with its own ripple, and the time-zone beam)."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 1.945,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 200 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 3.48,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 193 ms."
        }
      ],
      "signatures": [
        {
          "file": "calendars.ts",
          "declarations": "import type { World } from './world';\nexport declare const HOURS: readonly [\n    \"working hours\",\n    \"early or late\",\n    \"night\",\n    \"day off\"\n];\nexport declare const BUSY: readonly [\n    \"free\",\n    \"focus time\",\n    \"tentative hold\",\n    \"movable meeting\",\n    \"fixed meeting\",\n    \"travelling\",\n    \"on leave\"\n];\nexport type BusyKind = 'focus' | 'tentative' | 'internal' | 'team' | 'one' | 'external' | 'travel' | 'leave';\nexport declare const BUSY_LEVEL: Record<BusyKind, number>;\nexport type CalEvent = {\n    i: number;\n    p: number;\n    s: number;\n    n: number;\n    kind: BusyKind;\n    title: string;\n    movable: boolean;\n};\nexport type Hours = {\n    core: [\n        number,\n        number\n    ];\n    stretch: [\n        number,\n        number\n    ];\n};\nexport type Calendars = {\n    grid: Uint8Array;\n    owner: Int32Array;\n    events: CalEvent[];\n    byPerson: CalEvent[][];\n    hours: Hours[];\n};\nexport declare const isMovable: (kind: BusyKind) => boolean;\nexport declare function emptyCalendars(world: World, hours?: Hours[]): Calendars;\nexport declare function addEvent(world: World, cal: Calendars, ev: {\n    person: string | number;\n    s: number;\n    n: number;\n    kind: BusyKind;\n    title: string;\n}, force?: boolean): number;\nexport type BuildOptions = {\n    seed?: number;\n    keepFree?: Map<string, Set<number>>;\n};\nexport declare function buildCalendars(world: World, { seed, keepFree }?: BuildOptions): Calendars;"
        },
        {
          "file": "ics.ts",
          "declarations": "import type { Meeting } from './scheduler';\nimport type { World } from './world';\nexport type IcsPerson = {\n    name: string;\n    email: string;\n};\nexport type IcsAttendee = IcsPerson & {\n    role?: 'CHAIR' | 'REQ-PARTICIPANT' | 'OPT-PARTICIPANT' | 'NON-PARTICIPANT';\n    partstat?: 'NEEDS-ACTION' | 'ACCEPTED' | 'DECLINED' | 'TENTATIVE';\n    rsvp?: boolean;\n};\nexport type IcsEvent = {\n    uid: string;\n    start: number | Date;\n    end: number | Date;\n    summary: string;\n    location?: string;\n    description?: string;\n    organizer: IcsPerson;\n    attendees: IcsAttendee[];\n    sequence?: number;\n    stamp?: number | Date;\n    alarm?: number | null;\n    method?: 'REQUEST' | 'PUBLISH' | 'CANCEL';\n    prodId?: string;\n};\nexport declare function utcStamp(t: number | Date): string;\nexport declare const escapeText: (t: string) => string;\nexport declare function paramValue(t: string): string;\nexport declare function foldLine(line: string, limit?: number): string;\nexport declare const unfold: (text: string) => string[];\nexport declare function ics(ev: IcsEvent): string;\nexport declare const icsDataUrl: (text: string) => string;\nexport declare function inviteFor(world: World, inst: Meeting, o: {\n    summary: string;\n    organizer: IcsPerson;\n    domain: string;\n    attendees: Array<[\n        string,\n        'req' | 'opt'\n    ]>;\n    location?: string;\n    agenda?: string[];\n    note?: string;\n    sequence?: number;\n    stamp?: number | Date;\n}): IcsEvent;"
        },
        {
          "file": "scheduler.ts",
          "declarations": "import { type BusyKind, type CalEvent, type Calendars } from './calendars';\nimport { type Mode, type World } from './world';\nexport type Rule = {\n    id: string;\n    a: string;\n    b: string;\n    min: number;\n    max: number;\n    pair: 'prevA' | 'nextB' | 'cadence';\n    hard: boolean;\n    text: string;\n    breakAfter?: number;\n};\nexport type MeetingSpec = {\n    id?: string;\n    series: string;\n    k: number;\n    label: string;\n    win: [\n        number,\n        number\n    ];\n    start?: number | null;\n    city?: string | null;\n};\nexport type Rsvp = '' | 'yes' | 'maybe' | 'no';\nexport type Meeting = {\n    id: string;\n    series: string | null;\n    k: number;\n    label: string;\n    win: [\n        number,\n        number\n    ];\n    dur: number;\n    mode: Mode;\n    city: string | null;\n    req: string[];\n    opt: string[];\n    locked: boolean;\n    start: number | null;\n    deputies: Record<string, string>;\n    sent: boolean;\n    rsvp: Record<string, Rsvp>;\n    note: string;\n};\nexport type Plan = Meeting[];\nexport type Level = 'ok' | 'cost' | 'block' | 'miss';\nexport type Why = {\n    p: string | null;\n    level: Level;\n    kind: string;\n    text: string;\n    event: CalEvent | null;\n    required: boolean;\n};\nexport type Evaluation = {\n    ok: boolean;\n    cost: number;\n    why: Why[];\n};\nexport type Candidate = {\n    start: number;\n    cost: number;\n    score: number;\n    why?: Why[];\n};\nexport type Violation = {\n    key: string;\n    rule: Rule;\n    a: Meeting;\n    b: Meeting;\n    days: number;\n};\nexport type Issue = {\n    id: string;\n    other?: string;\n    level: 'block' | 'rule' | 'warn' | 'note';\n    kind: string;\n    p: string | null;\n    text: string;\n    event?: CalEvent | null;\n    rule?: Rule;\n    days?: number;\n    impossible?: string;\n};\nexport type Change = {\n    id: string;\n    from: number | null;\n    to: number | null;\n    why: Rule | null;\n};\nexport type Ripple = {\n    plan: Plan;\n    changes: Change[];\n    unresolved: Violation[];\n};\nexport type Advice = {\n    kind: 'move';\n    start: number;\n    score: number;\n    title: string;\n    detail: string;\n    ripple: Change[];\n    unresolved: number;\n} | {\n    kind: 'ask';\n    p: string;\n    event: number;\n    title: string;\n    detail: string;\n} | {\n    kind: 'deputy';\n    p: string;\n    d: string;\n    title: string;\n    detail: string;\n    ok: boolean;\n} | {\n    kind: 'optional';\n    p: string;\n    title: string;\n    detail: string;\n};\nexport type Prefs = {\n    searchHours: [\n        number,\n        number\n    ];\n    inPersonStart: number;\n    homeHours: [\n        number,\n        number\n    ];\n    longDays: number[];\n};\nexport type SchedulerOptions = {\n    world: World;\n    meetings: MeetingSpec[];\n    rules: Rule[];\n    calendars?: Calendars;\n    seed?: number;\n    solve?: boolean;\n    solveOrder?: string[];\n    prefs?: Partial<Prefs>;\n};\nexport type Scheduler = ReturnType<typeof createScheduler>;\nexport declare const scoreOf: (cost: number) => number;\nexport declare function createScheduler(opts: SchedulerOptions): {\n    world: {\n        year: number;\n        days: number;\n        slots: number;\n        spd: number;\n        home: string;\n        startMs: number;\n        offices: import(\"./world\").Office[];\n        officeById: Record<string, import(\"./world\").Office>;\n        people: import(\"./world\").Person[];\n        pi: Record<string, number>;\n        series: import(\"./world\").SeriesSpec[];\n        seriesById: {\n            [k: string]: import(\"./world\").SeriesSpec;\n        };\n        person: (id: string) => import(\"./world\").Person;\n        offset: (office: string, s: number) => number;\n        local: (office: string, s: number) => {\n            day: number;\n            h: number;\n        };\n        slotOf: (office: string, day: number, h: number) => number;\n        homeDay: (s: number) => number;\n        dateOf: (day: number) => import(\"./date-math\").PlainDate;\n        dayOf: (m: number, d: number, y?: number) => number;\n        weekday: (day: number) => number;\n        holidayIn: (office: string, day: number) => string | null;\n        isOffDay: (office: string, day: number) => boolean;\n        zone: (office: string, s: number) => string;\n        slotMs: (s: number) => number;\n        clockChanges: (office: string) => {\n            slot: number;\n            from: number;\n            to: number;\n        }[];\n        fmtDay: (day: number, { year: withYear, weekday: withWeekday }?: {\n            year?: boolean | undefined;\n            weekday?: boolean | undefined;\n        }) => string;\n        fmtWhen: (s: number, dur: number, office?: string) => string;\n        fmtTime: (s: number, office?: string) => string;\n        monthName: (m: number) => string;\n        weekdayName: (day: number) => string;\n    };\n    cal: Calendars;\n    rules: Rule[];\n    active: Set<string>;\n    prefs: Prefs;\n    readonly plan: Plan;\n    subscribe: (f: (what: {\n        kind: string;\n        [k: string]: unknown;\n    }) => void) => () => void;\n    byId: (id: string) => Meeting | null;\n    title: (inst: Meeting) => string;\n    attendees: (inst: Meeting) => {\n        req: string[];\n        opt: string[];\n    };\n    everyone: (inst: Meeting) => string[];\n    violations: (pl?: Plan, { soft }?: {\n        soft?: boolean | undefined;\n    }) => Violation[];\n    interval: (pl: Plan, inst: Meeting) => [\n        number,\n        number\n    ] | null;\n    issues: (pl?: Plan) => Issue[];\n    advise: (id: string, known?: Issue[]) => Advice[];\n    ripple: (id: string, start: number, base?: Plan) => Ripple;\n    find: (inst: Meeting, { from, to, pl, k, ideal, explain }?: {\n        from?: number;\n        to?: number;\n        pl?: Plan;\n        k?: number;\n        ideal?: number | null;\n        explain?: boolean;\n    }) => Candidate[];\n    repair: (pl: Plan, pinned?: Set<string>, maxIt?: number, leave?: Set<string>) => {\n        changes: Change[];\n        unresolved: Violation[];\n    };\n    solve: (pl?: Plan) => Plan;\n    settle: (pl: Plan, pinned?: Set<string>, rounds?: number) => Plan;\n    clonePlan: (pl: Plan) => Plan;\n    cantMeet: (v: Violation, pl?: Plan) => string | null;\n    links(pl?: Plan): {\n        rule: Rule;\n        a: Meeting;\n        b: Meeting;\n        days: number;\n        ok: boolean;\n        pause: boolean;\n    }[];\n    evaluate: (inst: Meeting, s: number, explain?: boolean, pl?: Plan) => Evaluation;\n    move(id: string, start: number, { cascade }?: {\n        cascade?: boolean | undefined;\n    }): Ripple | {\n        changes: Change[];\n        unresolved: Violation[];\n    };\n    solveYear(): {\n        id: string;\n        from: number | null;\n        to: number | null;\n    }[];\n    adopt(pl: Plan, what?: {\n        kind: string;\n    }): void;\n    setRule(id: string, patch: {\n        min?: number;\n        max?: number;\n        hard?: boolean;\n    }): void;\n    setActive(id: string, on: boolean): void;\n    setAttendee(instId: string, pid: string, role: \"req\" | \"opt\" | null): void;\n    setDeputy(instId: string, pid: string, dep: string | null): void;\n    askMove(evIndex: number): CalEvent | null;\n    addEvent(pid: string, s: number, n: number, kind: BusyKind, title: string): number;\n    refreshCalendars(): void;\n    setRsvp(id: string, pid: string, v: Rsvp): void;\n    markSent(ids: string[]): void;\n    draft(o: Partial<Meeting> & {\n        req: string[];\n    }): Meeting;\n    cost(inst: Meeting): {\n        hours: number;\n        travel: number;\n        total: number;\n        people: number;\n    };\n    serialize(): {\n        v: number;\n        plan: {\n            id: string;\n            start: number | null;\n            req: string[];\n            opt: string[];\n            deputies: Record<string, string>;\n            sent: boolean;\n            rsvp: Record<string, Rsvp>;\n        }[];\n        rules: {\n            id: string;\n            min: number;\n            max: number;\n            hard: boolean;\n        }[];\n        active: string[];\n    };\n    restore(o: unknown): boolean;\n};"
        },
        {
          "file": "world.ts",
          "declarations": "import { type PlainDate } from './date-math';\nimport { type OffsetFn } from './zones';\nexport declare const SPD = 48;\nexport type HolidaySpec = {\n    m: number;\n    d: number;\n    name: string;\n};\nexport type OfficeSpec = {\n    id: string;\n    name: string;\n    timeZone: string;\n    offsetOf?: OffsetFn;\n    window: [\n        number,\n        number\n    ];\n    core?: [\n        number,\n        number\n    ];\n    region?: string;\n    weekend?: number[];\n    holidays?: HolidaySpec[];\n};\nexport type PersonSpec = {\n    id: string;\n    name: string;\n    initials?: string;\n    office: string;\n    busy?: number;\n    core?: [\n        number,\n        number\n    ];\n    deputy?: string | null;\n    email?: string;\n    team?: [\n        number,\n        string\n    ] | null;\n    leave?: Array<[\n        number,\n        number,\n        number,\n        number\n    ]>;\n    extra?: boolean;\n};\nexport type Mode = 'video' | 'in-person' | 'broadcast';\nexport type SeriesSpec = {\n    id: string;\n    name: string;\n    short: string;\n    dur: number;\n    mode: Mode;\n    city?: string;\n    req: string[];\n    opt: string[];\n    quorum?: {\n        must: string[];\n        min: number;\n    };\n    minGap?: number;\n    fixedAttendance?: boolean;\n    agenda?: string[];\n    about?: string;\n};\nexport type WorldSpec = {\n    year: number;\n    home: string;\n    offices: OfficeSpec[];\n    people: PersonSpec[];\n    series: SeriesSpec[];\n};\nexport type Office = OfficeSpec & {\n    core: [\n        number,\n        number\n    ];\n    region: string;\n    weekend: number[];\n    offsets: Int16Array;\n    holidayDays: Map<number, string>;\n};\nexport type Person = PersonSpec & {\n    initials: string;\n    deputy: string | null;\n    email: string;\n    busy: number;\n};\nexport type World = ReturnType<typeof createWorld>;\nexport declare const fmtHM: (h: number) => string;\nexport declare function createWorld(spec: WorldSpec): {\n    year: number;\n    days: number;\n    slots: number;\n    spd: number;\n    home: string;\n    startMs: number;\n    offices: Office[];\n    officeById: Record<string, Office>;\n    people: Person[];\n    pi: Record<string, number>;\n    series: SeriesSpec[];\n    seriesById: {\n        [k: string]: SeriesSpec;\n    };\n    person: (id: string) => Person;\n    offset: (office: string, s: number) => number;\n    local: (office: string, s: number) => {\n        day: number;\n        h: number;\n    };\n    slotOf: (office: string, day: number, h: number) => number;\n    homeDay: (s: number) => number;\n    dateOf: (day: number) => PlainDate;\n    dayOf: (m: number, d: number, y?: number) => number;\n    weekday: (day: number) => number;\n    holidayIn: (office: string, day: number) => string | null;\n    isOffDay: (office: string, day: number) => boolean;\n    zone: (office: string, s: number) => string;\n    slotMs: (s: number) => number;\n    clockChanges: (office: string) => {\n        slot: number;\n        from: number;\n        to: number;\n    }[];\n    fmtDay: (day: number, { year: withYear, weekday: withWeekday }?: {\n        year?: boolean | undefined;\n        weekday?: boolean | undefined;\n    }) => string;\n    fmtWhen: (s: number, dur: number, office?: string) => string;\n    fmtTime: (s: number, office?: string) => string;\n    monthName: (m: number) => string;\n    weekdayName: (day: number) => string;\n};"
        }
      ],
      "pitfalls": [
        "Never hard-code clock-change dates",
        "A clock changes at a time of day, not at midnight",
        "world.slotOf() asks for an offset twice",
        "A long video call across far-apart zones can fit for half the year only",
        "Rules count days in the home office’s calendar",
        "The scheduler adds up costs from prefix sums made when it is created",
        "A quorum lets a required person be missed only if they are outside its must-list",
        "ripple() mends only what its move breaks",
        "solve() places the series in order, then repair()",
        "A named series keeps its order",
        "In-person days with everyone required are the hardest to place",
        "An iCalendar parameter value (a CN) is never backslash-escaped",
        "Fold at 75 octets, not 75 characters, and never inside a character",
        "Keep the UID when a meeting moves and raise SEQUENCE on every change to a sent invite",
        "Under a strict Content Security Policy, offer the .ics through a data",
        "Generated calendars are for trying it"
      ],
      "card": "entries/meeting-scheduler.json"
    },
    {
      "id": "menu-skins",
      "aliases": [],
      "name": "Context menus: one keyboard core, many skins",
      "summary": "One accessible context-menu core (roles, arrow keys, type-ahead, letter keys, Esc, focus kept and given back, stays on screen, right-click, long-press and Shift+F10) and eight looks for it: a fan of cards, an orbit ring, a tool rack, a label printer, an index card, a radial disc, a gesture ring you can flick through and a tile popover that assembles piece by piece. A skin is a small object; add your own, or restyle one through its parts.",
      "category": "ui",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "context menu",
        "accessibility",
        "keyboard",
        "long-press",
        "pie menu",
        "gesture ring",
        "flick",
        "web animations",
        "dom",
        "css",
        "no dependencies"
      ],
      "useCases": [
        "right-click menus in apps and editors",
        "file and board actions",
        "touch long-press actions",
        "game and themed interfaces",
        "radial tool pickers",
        "quick flick commands",
        "playful tile menus"
      ],
      "interaction": "Right-click or long-press a file or the desk · Shift+F10 from the keyboard · pick a skin above · on the gesture ring, flick out through a sector",
      "kits": [
        {
          "kit": "foundations",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "keyboard-shortcuts",
          "why": "Shortcuts shown beside the items"
        },
        {
          "id": "command-palette",
          "why": "The same actions by search"
        },
        {
          "id": "beside-placement",
          "why": "Submenus and popovers placed by the same rules"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 0.01,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured opening and closing a menu every 0.8 s across the six skins (each open builds, lays out and focuses the menu inside the timed frame; the animations run on the compositor). Idle, the menus cost nothing."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 0.01,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 37 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.02,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 68 ms."
        }
      ],
      "signatures": [
        {
          "file": "menu.ts",
          "declarations": "export type Point = {\n    x: number;\n    y: number;\n};\nexport type Box = {\n    left: number;\n    top: number;\n    right: number;\n    bottom: number;\n};\nexport type MenuItem = {\n    id: string;\n    label: string;\n    key?: string;\n    disabled?: boolean | string;\n};\nexport type OpenedBy = 'mouse' | 'touch' | 'pen' | 'keyboard' | 'code';\nexport type SkinContext = {\n    menu: HTMLElement;\n    items: HTMLElement[];\n    list: MenuItem[];\n    at: Point;\n    area: Box;\n    title: HTMLElement;\n    state: Record<string, number | boolean | string>;\n    touch: boolean;\n};\nexport type Skin = {\n    id: string;\n    name: string;\n    className: string;\n    ring?: boolean;\n    focusDelay?: number;\n    build?(ctx: SkinContext): void;\n    layout(ctx: SkinContext): void;\n    enter?(ctx: SkinContext): void;\n    leave?(ctx: SkinContext): number;\n    aim?(ctx: SkinContext, p: Point): number;\n    focus?(ctx: SkinContext, index: number): void;\n    track?(ctx: SkinContext, p: Point, last: (Point & {\n        ms: number;\n    }) | null): number;\n    columns?: number;\n};\nexport type MenuOptions = {\n    at: Point;\n    items: MenuItem[];\n    skin: Skin;\n    onPick(item: MenuItem): void;\n    title?: string;\n    caption?: string;\n    host?: HTMLElement;\n    area?: HTMLElement | Box;\n    motion?: boolean;\n    returnFocus?: HTMLElement | null;\n    heldPointer?: number;\n    onClose?(): void;\n};\nexport type MenuHandle = {\n    el: HTMLElement;\n    close(instant?: boolean): void;\n    readonly open: boolean;\n};\nexport declare function onEscape(close: () => void): () => void;\nexport declare function clampToViewport(x: number, y: number, w: number, h: number, margin?: number, area?: Box): {\n    left: number;\n    top: number;\n};\nexport declare function gridStep(i: number, n: number, cols: number, down: boolean): number;\nexport declare function keyList(container: HTMLElement, { itemSelector, ring, cols }?: {\n    itemSelector?: string | undefined;\n    ring?: boolean | undefined;\n    cols?: number | undefined;\n}): () => void;\nexport declare const currentMenu: () => MenuHandle | null;\nexport declare function openMenu(options: MenuOptions): MenuHandle;\nexport declare function placeBox(ctx: SkinContext, dx?: number, dy?: number, margin?: number): {\n    w: number;\n    h: number;\n    origin: {\n        x: number;\n        y: number;\n    };\n    left: number;\n    top: number;\n};\nexport type MenuRequest = {\n    at: Point;\n    by: OpenedBy;\n    target: Element;\n};\nexport declare function contextMenu(surface: HTMLElement, request: (req: MenuRequest) => Omit<MenuOptions, 'at'> | null | undefined, { holdMs, slop, onHold }?: {\n    holdMs?: number;\n    slop?: number;\n    onHold?: (at: Point | null) => void;\n}): () => void;"
        },
        {
          "file": "skins.ts",
          "declarations": "import { type Skin } from './menu';\nexport declare const cards: Skin;\nexport declare const orbit: Skin;\nexport declare const rack: Skin;\nexport declare function barcode(text: string, height?: number): string;\nexport declare const printer: Skin;\nexport declare const card: Skin;\nexport declare const disc: Skin;\nexport declare const ring: Skin;\nexport declare const tiles: Skin;\nexport declare const skins: Skin[];"
        }
      ],
      "pitfalls": [
        "The keyboard opens the menu twice if you let it",
        "Long-press needs -webkit-touch-callout",
        "A menu is position: fixed in client pixels",
        "Skins that position items with the CSS translate property animate translate, scale and opacity",
        "The finger that ends a long-press clicks whatever is under it",
        "Letter keys pick straight away (O for Open)",
        "A flick picks on speed alone",
        "The gesture ring and the radial disc share the registered --ms-sel angle (in skins.css)",
        "A skin with columns gets grid keys (Up and Down a row, Left and Right one item)"
      ],
      "card": "entries/menu-skins.json"
    },
    {
      "id": "mesh-dents",
      "aliases": [],
      "name": "Dents on any mesh",
      "summary": "Crash dents on car bodies, barrels, panels and props, drawn by the GPU from one small table of objects × dent slots. The vertex shader pushes a rounded bowl in along the hit, with a little crumple; the pixels lean the normal into it (the true slope, so even a big flat face shows it) and scuff the paint darker and rougher. On the CPU a ray snaps each hit onto the surface, a hit near an old dent deepens it, the oldest dent makes way when a slot is full, and dents punch in with a small overshoot and fade back out on repair. It wraps any standard or physical node material, keeping its own colour, normal map, roughness and clearcoat, and reads the table from a storage buffer on WebGPU or a float data texture on WebGL2.",
      "category": "technique",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "calm",
      "tags": [
        "dents",
        "damage",
        "deformation",
        "vertex displacement",
        "normal perturbation",
        "crash",
        "impact",
        "car body",
        "vehicle damage",
        "repair",
        "storage buffer",
        "data texture",
        "WebGL2 fallback",
        "per-object uniforms",
        "shared materials",
        "raycast placement",
        "clearcoat",
        "three.js",
        "TSL",
        "no dependencies"
      ],
      "useCases": [
        "car crashes in a racing or driving game: dents where it hit, deeper with each knock",
        "props that take hits: barrels, bins, lockers, signs, doors, metal sheds",
        "a ball, a ram or debris denting what it strikes, from the contact point and speed",
        "repairing damage over a second or two: a pit stop, a workshop, a reset",
        "many objects sharing one material, each with its own dents",
        "damage that must run on WebGL2 as well as WebGPU"
      ],
      "interaction": "Click the car, a barrel or the sign to dent it · click the floor to roll a ball through that spot · drag to orbit",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "race-car",
          "why": "Dents from the car’s impacts"
        },
        {
          "id": "breakable-world",
          "why": "Dents on what bends, holes in what breaks"
        },
        {
          "id": "wear-grime",
          "why": "Scratches and dirt round the dents"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "mixed",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-13",
          "gpuMs": 1.007,
          "cpuMs": 0.875,
          "cpuP95Ms": 1.505,
          "badge": "moderate",
          "drawCalls": 62,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with nine dents placed ahead on all four things (so every dented mesh runs its loops per vertex and per pixel) and a ball rolled at something every 1.2 s, its dents popping in; a repair every 6 s. Shadows from one key light and a room environment. Standing still outside the bench, nothing is drawn at all."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 7.766,
          "cpuMs": 1.558,
          "cpuP95Ms": 2.615,
          "badge": "heavy",
          "drawCalls": 62,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 13.42,
            "p99Ms": 16.28,
            "low1Fps": 42.1
          },
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 1342 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 10.21,
          "cpuMs": 1.18,
          "cpuP95Ms": 4.66,
          "badge": "heavy",
          "drawCalls": 62,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 3978 ms."
        }
      ],
      "signatures": [
        {
          "file": "dent-table.ts",
          "declarations": "export type Vec3 = {\n    x: number;\n    y: number;\n    z: number;\n};\nexport type Dent = {\n    centre: Vec3;\n    radius: number;\n    direction: Vec3;\n    depth: number;\n};\nexport type DentTableOptions = {\n    objects?: number;\n    perObject?: number;\n    merge?: number;\n    deepest?: number;\n    pop?: number;\n};\nexport type Added<K> = {\n    slot: number;\n    index: number;\n    deepened: boolean;\n    evicted?: K;\n};\nexport declare const DENT_FLOATS = 8;\nexport declare function punch(t: number): number;\nexport declare function ease(t: number): number;\nexport declare function dentFromSpeed(speed: number, scale?: number): {\n    radius: number;\n    depth: number;\n};\nexport declare class DentTable<K> {\n    readonly objects: number;\n    readonly perObject: number;\n    readonly data: Float32Array;\n    merge: number;\n    deepest: number;\n    pop: number;\n    version: number;\n    constructor(options?: DentTableOptions);\n    slotOf(key: K): number;\n    used(key: K): number;\n    count(key: K): number;\n    keys(): K[];\n    get busy(): boolean;\n    read(key: K, index: number): Dent | null;\n    goal(key: K, index: number): number;\n    add(key: K, dent: Dent): Added<K>;\n    repair(key?: K, seconds?: number): void;\n    clear(key?: K): void;\n    step(dt: number): boolean;\n}"
        },
        {
          "file": "mesh-dents.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { UniformNode } from 'three/webgpu';\nimport { DentTable, type DentTableOptions, type Vec3 } from './dent-table';\nexport type DentStore = 'storage' | 'texture';\nexport type DentableMaterial = THREE.MeshStandardNodeMaterial | THREE.MeshPhysicalNodeMaterial;\nexport type MeshDentsOptions = DentTableOptions & {\n    store?: DentStore;\n    crumple?: number;\n    crumpleScale?: number;\n    lean?: number;\n    scuff?: {\n        colour?: THREE.ColorRepresentation;\n        amount?: number;\n        roughness?: number;\n    };\n};\nexport type DentHit = {\n    point: Vec3;\n    direction?: Vec3;\n    radius: number;\n    depth: number;\n    place?: boolean;\n    reach?: number;\n};\nexport type DentResult = {\n    point: THREE.Vector3;\n    meshes: THREE.Mesh[];\n    deepened: boolean;\n};\nexport declare class MeshDents {\n    static storeFor(renderer: THREE.Renderer): DentStore;\n    readonly table: DentTable<THREE.Object3D>;\n    readonly store: DentStore;\n    readonly crumple: UniformNode<'float', number>;\n    readonly lean: UniformNode<'float', number>;\n    readonly scuff: UniformNode<'float', number>;\n    constructor(options?: MeshDentsOptions);\n    wraps(material: THREE.Material): boolean;\n    wrap<M extends DentableMaterial>(material: M, store?: DentStore): M;\n    unwrap(material: THREE.Material): void;\n    add(target: THREE.Object3D, hit: DentHit): DentResult | null;\n    repair(target?: THREE.Object3D, seconds?: number): void;\n    clear(target?: THREE.Object3D): void;\n    count(target: THREE.Object3D): number;\n    update(dt: number): boolean;\n    get busy(): boolean;\n    dispose(): void;\n}"
        }
      ],
      "pitfalls": [
        "Wrap a material before it is first compiled, and never change it on the first dent",
        "The lean is what shows a dent on a big flat face",
        "A physical material with clearcoat shades its coat with its own normal (`clearcoatNormalNode`)",
        "Dents live in each mesh’s own space, after skinning and morphs",
        "Storage buffers are WebGPU only, and a WebGPU device in compatibility mode may allow none in a…",
        "Not a uniform array for WebGL2",
        "The table is written in place and uploaded whole when its version changes",
        "Snap hits onto the undented surface (`place`, on by default)",
        "A dent is a sphere in the mesh’s own space",
        "The bounding sphere is not grown"
      ],
      "card": "entries/mesh-dents.json"
    },
    {
      "id": "metaball-liquid",
      "aliases": [],
      "name": "Metaball liquid drops",
      "summary": "Liquid as GPU particles that merge like metaballs, in raw WebGPU: a compute pass moves the drops (free fall with drag, beads that swell on an edge and then let go, runners that slide down a panel’s side leaving a wet trail that dries), each frame they are splatted into a half-size field stretched along their speed, and a full-screen pass thresholds it and shades it as glossy, translucent liquid with a refraction rim, light gathered on the far side, a sharp highlight, a window reflection and a soft shadow. Bursts, single drops, beads, runs and aimed pours that land where you point. Nothing is read back, and it draws nothing once the last drop is gone. Without WebGPU a WebGL2 twin draws the same liquid, its drops stepped on the CPU.",
      "category": "particles",
      "role": "hero-visual",
      "stack": [
        "webgpu"
      ],
      "character": "expressive",
      "tags": [
        "metaballs",
        "liquid",
        "drops",
        "splash",
        "pour",
        "particles",
        "compute",
        "splat",
        "field",
        "threshold",
        "dom + gpu",
        "raw webgpu",
        "wgsl",
        "glsl",
        "webgl2 fallback",
        "timestamp queries",
        "rests when idle",
        "touch",
        "no dependencies"
      ],
      "useCases": [
        "a splash when something is confirmed, completed or celebrated",
        "pouring a value into a gauge or a glass (a progress that fills)",
        "a playful drink, food or paint theme where cards drip after a press",
        "drops and drips over a page without touching its layout",
        "a liquid trail behind a drag"
      ],
      "interaction": "Squeeze a flavour into the glass · click the open page to splash · drag to fling",
      "kits": [],
      "pairsWith": [
        {
          "id": "splash-paint",
          "why": "Paint flowing behind the drops"
        },
        {
          "id": "liquid-glass",
          "why": "Drops running down glass panels"
        },
        {
          "id": "card-springs",
          "why": "Cards the drops bead on"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 0.085,
          "cpuMs": 0.155,
          "cpuP95Ms": 0.325,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.3,
            "p99Ms": 17.985,
            "low1Fps": 55
          },
          "notes": "A pour running into the glass all the time, a splash of 40 drops every quarter second, runners and beads on the cards: about 1,500 to 2,500 live drops of the 4,096, splatted into a half-size field and shaded full screen; timed with its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.197,
          "cpuMs": 0.22,
          "cpuP95Ms": 0.335,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.65,
            "p99Ms": 17.55,
            "low1Fps": 56.1
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 61 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 4.652,
          "cpuMs": 0.62,
          "cpuP95Ms": 0.84,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 279 ms."
        }
      ],
      "signatures": [
        {
          "file": "liquid.ts",
          "declarations": "import { beadRow, dropRow, runRows, type BurstOptions, type Rand } from './drops';\nexport type LiquidOptions = {\n    capacity?: number;\n    scale?: number;\n    gravity?: number;\n    random?: Rand;\n    device?: GPUDevice;\n    onError?: (message: string) => void;\n    onLost?: (message: string) => void;\n};\ntype Point = readonly [\n    number,\n    number\n];\nexport type PourOptions = {\n    from: Point | (() => Point);\n    to: Point | (() => Point);\n    seconds?: number;\n    rate?: number;\n    r?: number;\n    colour?: string;\n    flight?: number;\n};\nexport type Liquid = {\n    device: GPUDevice | null;\n    api: 'webgpu' | 'webgl2';\n    resize(width: number, height: number, dpr: number): void;\n    burst(o: BurstOptions): void;\n    drop(o: Parameters<typeof dropRow>[0]): void;\n    bead(o: Parameters<typeof beadRow>[0]): void;\n    run(o: Parameters<typeof runRows>[0]): void;\n    pour(o: PourOptions): Promise<void>;\n    clear(): void;\n    gravity: number;\n    gloss: number;\n    shadow: number;\n    alive(): number;\n    frame(dt: number): boolean;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare function createLiquid(canvas: HTMLCanvasElement, { capacity, scale, gravity, random, device: given, onError, onLost }?: LiquidOptions): Promise<Liquid | null>;\nexport {};"
        }
      ],
      "pitfalls": [
        "Splat into a field at half the page’s size or less",
        "The field must be a float format (rgba16float) with additive blending",
        "Store colour times weight, and divide by the weight when shading",
        "The liquid lives on the GPU and is never read back",
        "The drops sit in a ring buffer",
        "Aim a pour by solving the throw (aim: vx = dx / t, vy = (dy − g t² / 2) / t) and kill each drop…",
        "Put the canvas over the page with pointer-events",
        "Under reduced motion skip the particles",
        "The device can be lost after the liquid starts (a driver reset, the GPU process gone)",
        "Resize on a new pixel ratio too",
        "Without WebGPU, createLiquid starts the WebGL2 twin on the same canvas (liquid-gl.ts)"
      ],
      "card": "entries/metaball-liquid.json"
    },
    {
      "id": "micro-interactions",
      "aliases": [],
      "name": "Micro-interactions pack",
      "summary": "Magnetic buttons, springy flip cards, tilt with sheen, rolling and split-flap numbers, fling-to-dismiss, toasts, toasts that hang on a string and swing to rest, shake, a choreography sequencer and a pointer light trail that rests when the pointer does. Plain DOM, CSS and Canvas 2D, every piece disposable; restyle it through its parts and states.",
      "category": "ui",
      "role": "interaction",
      "stack": [
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "dom",
        "css",
        "springs",
        "animation",
        "web animations",
        "canvas 2d",
        "pointer trail",
        "toasts",
        "accessibility",
        "no dependencies"
      ],
      "useCases": [
        "buttons and calls to action",
        "cards and dashboards",
        "notifications",
        "playful notifications on a string",
        "counters and prices",
        "forms that refuse nicely",
        "onboarding",
        "a cursor that leaves light behind it on a dark page"
      ],
      "interaction": "Everything is live: hover, drag, click, type · move the pointer anywhere for the light trail",
      "kits": [
        {
          "kit": "shop",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "ui-sounds",
          "why": "A sound for each small moment"
        },
        {
          "id": "card-springs",
          "why": "Cards with the same springy feel"
        },
        {
          "id": "impact-plates",
          "why": "Bigger moments the whole page feels"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0.03,
          "cpuP95Ms": 0.045,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured idle, the pointer away from the buttons: the per-frame cost is the magnetic springs checking their buttons. While the pointer pulls them, each moving button adds a style write."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.04,
          "cpuP95Ms": 0.08,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 46 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.04,
          "cpuP95Ms": 0.08,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 80 ms."
        }
      ],
      "signatures": [
        {
          "file": "fx.ts",
          "declarations": "type Stop = () => void;\nexport type Theme = {\n    id: string;\n    name: string;\n    vars: Record<string, string>;\n    swatch?: string;\n};\nexport declare function themeSwitcher({ themes, target, mount, storageKey, onChange, label, keys }: {\n    themes: Theme[];\n    target?: HTMLElement;\n    mount?: HTMLElement;\n    storageKey?: string | null;\n    onChange?: (theme: Theme, index: number) => void;\n    label?: string;\n    keys?: boolean;\n}): {\n    apply: (i: number) => void;\n    readonly current: Theme;\n    next: () => void;\n    stop: () => void;\n};\nexport declare function flipCard(el: HTMLElement, { axis, ms, onFlip, clickToFlip }?: {\n    axis?: 'x' | 'y';\n    ms?: number;\n    onFlip?: (back: boolean) => void;\n    clickToFlip?: boolean;\n}): {\n    flip: (to?: number) => void;\n    readonly flipped: boolean;\n    ms: number;\n    stop: () => void;\n};\nexport type MagneticOptions = {\n    mode?: 'pull' | 'push';\n    strength?: number;\n    radius?: number;\n    stiffness?: number;\n    damping?: number;\n    root?: ParentNode;\n    loop?: boolean;\n};\nexport declare function magnetic(selector: string, options?: MagneticOptions): {\n    step: () => void;\n    options: {\n        mode: \"pull\" | \"push\";\n        strength: number;\n        radius: number;\n        stiffness: number;\n        damping: number;\n        root: ParentNode;\n        loop: boolean;\n    };\n    stop: () => void;\n};\nexport declare function flingable(el: HTMLElement, { axis, distance, speed, onFling, onDrag }?: {\n    axis?: 'x' | 'y' | 'both';\n    distance?: number;\n    speed?: number;\n    onFling?: (way: {\n        x: number;\n        y: number;\n    }) => void;\n    onDrag?: (x: number, y: number) => void;\n}): Stop;\nexport declare function tilt(selector: string, { max, root }?: {\n    max?: number | undefined;\n    root?: (ParentNode & EventTarget) | undefined;\n}): {\n    options: {\n        max: number;\n    };\n    stop: () => void;\n};\nexport declare function rollNumber(el: HTMLElement, value: string | number, { flap, ms }?: {\n    flap?: boolean | undefined;\n    ms?: number | undefined;\n}): void;\nexport declare function shake(el: HTMLElement, { px, ms }?: {\n    px?: number | undefined;\n    ms?: number | undefined;\n}): Promise<Animation>;\nexport type Step = (() => unknown) | {\n    at?: number;\n    wait?: number;\n    run?: () => unknown;\n};\nexport declare function sequence(steps: Step[]): Promise<void>;\nexport declare const animate: (el: Element, keyframes: Keyframe[], options: KeyframeAnimationOptions) => Promise<Animation>;\nexport {};"
        },
        {
          "file": "tag.ts",
          "declarations": "import type { ToastAnimate } from './ui';\nexport type HangingTagOptions = {\n    drop?: number;\n    swing?: number;\n    damping?: number;\n    rate?: number;\n    breeze?: boolean;\n    reducedMotion?: () => boolean;\n};\nexport type TagPose = {\n    dy: number;\n    theta: number;\n    opacity: number;\n    settled: boolean;\n};\ndeclare const DEFAULTS: {\n    drop: number;\n    swing: number;\n    damping: number;\n    rate: number;\n    breeze: boolean;\n};\nexport declare function tagPose(t: number, { first, motion, ...o }?: Partial<typeof DEFAULTS> & {\n    first?: boolean;\n    motion?: boolean;\n}): TagPose;\nexport declare function hangingTags(options?: HangingTagOptions): {\n    animate: ToastAnimate;\n    stop(): void;\n    readonly swinging: number;\n};\nexport {};"
        },
        {
          "file": "trail.ts",
          "declarations": "export type TrailOptions = {\n    area?: HTMLElement;\n    layer?: HTMLElement;\n    life?: number;\n    height?: number;\n    samples?: number;\n    minStep?: number;\n    color?: string;\n    touch?: boolean;\n    reducedMotion?: () => boolean;\n    loop?: boolean;\n};\nexport type Trail = {\n    step(now?: number): boolean;\n    readonly active: boolean;\n    readonly options: Required<Pick<TrailOptions, 'life' | 'height' | 'minStep'>>;\n    refresh(): void;\n    clear(): void;\n    stop(): void;\n};\nexport declare function pointerTrail(options?: TrailOptions): Trail;"
        },
        {
          "file": "ui.ts",
          "declarations": "export declare function onEscape(close: () => void): () => void;\nexport declare const anyOpen: () => boolean;\nexport declare function clampToViewport(x: number, y: number, w: number, h: number, margin?: number): {\n    left: number;\n    top: number;\n};\nexport declare function keyList(container: HTMLElement, itemSelector?: string): () => void;\nexport declare function trapFocus(el: HTMLElement): () => void;\nexport declare function countUp(el: HTMLElement, to: number, { from, ms, format }?: {\n    from?: number | undefined;\n    ms?: number | undefined;\n    format?: ((v: number) => string) | undefined;\n}): void;\nexport type ToastAnimate = (toast: HTMLElement, phase: 'enter' | 'exit') => Promise<unknown> | void;\nexport declare function toastStack(container: HTMLElement, { max, animate }?: {\n    max?: number;\n    animate?: ToastAnimate;\n}): {\n    push(node: HTMLElement, ms?: number): HTMLElement;\n};\nexport declare function h<T extends HTMLElement = HTMLElement>(html: string): T;\nexport declare const esc: (s: unknown) => string;"
        }
      ],
      "pitfalls": [
        "flipCard turns the card in 3D on its own layer, where text is a little soft until the turn ends",
        "Magnetic reads every element’s getBoundingClientRect each frame",
        "Magnetic writes a CSS translate (not transform), so a style’s own transform still applies",
        "Flip cards need preserve-3d all the way down",
        "Split-flap steps need the digits’ strip height to match the line height (1em by default)",
        "prefers-reduced-motion turns off the magnetic pull, the strip transitions and tilt",
        "The trail’s canvas fills its layer, so give it a positioned layer that does not scroll",
        "The trail is decoration: it never says anything a person needs",
        "The trail’s colour is read once (and on refresh())",
        "Hanging tags pivot where the strings end",
        "A hanging tag writes its own transform while it swings",
        "A tag’s string is drawn outside its box (bottom: 100%)"
      ],
      "card": "entries/micro-interactions.json"
    },
    {
      "id": "minimap-compass",
      "aliases": [],
      "name": "Minimap, exploration and compass",
      "summary": "A change-driven navigation HUD: player-up or north-up minimap, numbered markers pinned at its rim, a saveable exploration bitmap, an accessible full map and a compass strip. Canvas redraws only for changed map content or position; turns move the map and player view cone with CSS transforms. No framework or map server required.",
      "category": "ui",
      "role": "foundation",
      "stack": [
        "dom",
        "canvas2d"
      ],
      "character": "calm",
      "tags": [
        "minimap",
        "compass",
        "fog of war",
        "exploration",
        "navigation",
        "HUD",
        "map",
        "bearing",
        "save",
        "keyboard",
        "canvas2d",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "navigation in a walking or driving game",
        "exploration maps with persistent discovery",
        "a north-up overview and player-up local map",
        "accessible bearings and destination lists"
      ],
      "interaction": "Click the view, then arrows or WASD to walk and turn · M opens the full map · Esc closes it · press Read bearing to hear your heading",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "game-cameras",
          "why": "Supply player position and the desired heading from the game camera."
        },
        {
          "id": "play-input",
          "why": "Use the same navigation on keyboard, gamepad and touch."
        },
        {
          "id": "heightfield-chunks",
          "why": "Paint terrain and landmarks into the map atlas."
        },
        {
          "id": "accessible-dialog",
          "why": "The full map uses its focus-managed dialog core."
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "canvas2d",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "orientation",
          "in": "module",
          "values": {
            "strict": "north",
            "playful": "player"
          },
          "note": "North-up keeps geography stable; player-up keeps forward at the top."
        },
        {
          "name": "range",
          "in": "module",
          "values": {
            "strict": 40,
            "refined": 60
          },
          "note": "A wider map gives context; a narrow map favours nearby details."
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": null,
          "cpuMs": 0.055,
          "cpuP95Ms": 0.13,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 0.49,
            "p99Ms": 1.135,
            "low1Fps": 760.9
          },
          "notes": "Navigation alone: a 64×64 exploration bitmap, three markers and a cached 1024-pixel atlas. A scripted walk updates the pose each frame; canvas redraws are coalesced to at most 10 Hz, while the compass and player view cone use CSS transforms. No 3D scene is constructed or rendered."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "intel xe-2lpg",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Microsoft Edge 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 1.638,
          "cpuMs": 0.955,
          "cpuP95Ms": 1.325,
          "badge": "moderate",
          "drawCalls": 22,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Microsoft Edge 157, Chromium 157 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 238 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 1.048,
          "cpuMs": 0.12,
          "cpuP95Ms": 0.18,
          "badge": "moderate",
          "drawCalls": 22,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 697 ms."
        }
      ],
      "signatures": [
        {
          "file": "fog.ts",
          "declarations": "export type Point = {\n    x: number;\n    z: number;\n};\nexport type Bounds = {\n    minX: number;\n    minZ: number;\n    maxX: number;\n    maxZ: number;\n};\nexport type FogSave = {\n    version: 1;\n    bounds: Bounds;\n    columns: number;\n    rows: number;\n    bits: string;\n};\nexport declare function validBounds(b: Bounds): boolean;\nexport declare class ExplorationFog {\n    readonly bounds: Readonly<Bounds>;\n    readonly columns: number;\n    readonly rows: number;\n    get revision(): number;\n    get byteLength(): number;\n    constructor(bounds: Bounds, columns?: number, rows?: number);\n    subscribe(fn: () => void): () => void;\n    cell(column: number, row: number): boolean;\n    explored(p: Point): boolean;\n    reveal(p: Point, radius: number): boolean;\n    clear(): void;\n    save(): FogSave;\n    restore(value: unknown): void;\n}"
        },
        {
          "file": "navigation.ts",
          "declarations": "import { ExplorationFog, type Bounds, type Point } from './fog';\nimport { type Orientation, type Pose } from './map-math';\nexport type MapMarker = Point & {\n    id: string;\n    label: string;\n    alwaysVisible?: boolean;\n};\nexport type NavigationOptions = {\n    map: {\n        bounds: Bounds;\n        paint(context: CanvasRenderingContext2D): void;\n    };\n    fog: ExplorationFog;\n    pose: Pose;\n    markers?: readonly MapMarker[];\n    orientation?: Orientation;\n    range?: number;\n    exploreRadius?: number;\n    intervalMs?: number;\n    dialogHost?: HTMLElement;\n};\nexport declare function createNavigation(host: HTMLElement, options: NavigationOptions): {\n    element: HTMLDivElement;\n    minimap: HTMLButtonElement;\n    compass: HTMLButtonElement;\n    stats: {\n        atlasDraws: number;\n        minimapDraws: number;\n        fullMapDraws: number;\n    };\n    setPose: (next: Pose) => void;\n    setMarkers: (next: readonly MapMarker[]) => void;\n    setOrientation: (next: Orientation) => void;\n    announceBearing: () => string;\n    openMap: () => void;\n    readonly mapOpen: boolean;\n    closeMap(): void;\n    invalidateMap(): void;\n    setRange(value: number): void;\n    dispose(): void;\n};"
        }
      ],
      "pitfalls": [
        "Coordinates are metres with +x east and +z south",
        "Import navigation.css and both dialog styles, base before look",
        "setPose answers turns with CSS transforms",
        "The atlas is cached at no more than 1024 pixels on its longest side",
        "Exploration is permanent discovery, not current visibility",
        "Markers are hidden until their cell is explored unless alwaysVisible is true",
        "The compass announces only when its button or announceBearing is called",
        "The full map defaults to document.body so its dialog makes the page inert",
        "The demo uses three.js 0.187 for its surrounding scene, with WebGL2 fallback"
      ],
      "card": "entries/minimap-compass.json"
    },
    {
      "id": "more-chart-types",
      "aliases": [],
      "name": "More chart types: treemap, box plot, calendar, radar…",
      "summary": "Fifteen chart types as plain functions that return SVG, each with its numbers as a table and words for every mark: squarified treemap, sunburst, waffle (shares that always add to 100), box plots and violins, histogram, calendar heatmap, streamgraph, Gantt, an XmR control chart that flags change, lollipop, dumbbell, radar, radial bar, rose and Pareto. Dates are summed per day, week or month, picked from how long they run, and titles follow the period. The maths is pure and tested; one small explorer reads any chart by pointer or arrow keys. Restyle it through its parts.",
      "category": "data",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "svg",
        "charts",
        "treemap",
        "box plot",
        "violin",
        "calendar heatmap",
        "streamgraph",
        "gantt",
        "control chart",
        "time series",
        "periods",
        "radar",
        "pareto",
        "viridis",
        "accessibility",
        "no dependencies"
      ],
      "useCases": [
        "dashboards and reports",
        "budgets and shares of a whole",
        "response times and other spreads",
        "activity over a year",
        "project plans",
        "spotting when a process changed",
        "summing dates per day, week or month",
        "product comparisons"
      ],
      "interaction": "Pick a chart · hover or tap its marks · Tab to it and use the arrow keys · Table shows its numbers",
      "kits": [
        {
          "kit": "dashboard",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "quiet-charts",
          "why": "The everyday charts in the same style"
        },
        {
          "id": "chart-access",
          "why": "Tables and words for every mark"
        },
        {
          "id": "sheet-chart-suggest",
          "why": "Picks the type that fits a sheet"
        }
      ],
      "variants": [],
      "version": "1.0.2",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0.52,
          "cpuP95Ms": 2.115,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured while the gallery cycles: every frame draws the next of the fifteen chart types at the stage’s size (the SVG string, innerHTML and the explorer’s listeners, without the draw-in), with new data after each full pass. Idle, nothing runs."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.898,
          "cpuP95Ms": 3.28,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 81 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 1.04,
          "cpuP95Ms": 5.26,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 92 ms."
        }
      ],
      "signatures": [
        {
          "file": "charts.ts",
          "declarations": "import { type StreamOffset, type TreeNode } from './geometry';\nexport type Fmt = (v: number) => string;\nexport declare const f0: Fmt;\nexport declare const esc: (s: unknown) => string;\nexport type DataTable = {\n    caption: string;\n    columns: string[];\n    rows: string[][];\n    numeric: boolean[];\n};\nexport type Chart = {\n    svg: string;\n    table: DataTable;\n    note?: string;\n};\nexport type ChartOptions = {\n    w: number;\n    h: number;\n    title?: string;\n    desc?: string;\n    fmt?: Fmt;\n    unit?: string;\n    text?: boolean;\n    motion?: boolean;\n};\nexport declare function treemap(root: TreeNode, o: ChartOptions): Chart;\nexport declare function sunburst(root: TreeNode, o: ChartOptions): Chart;\nexport type Share = {\n    label: string;\n    value: number;\n};\nexport declare function waffle(items: readonly Share[], o: ChartOptions): Chart;\nexport type Group = {\n    name: string;\n    values: readonly number[];\n};\nexport type SpreadOptions = ChartOptions & {\n    style?: 'box' | 'violin' | 'both';\n};\nexport declare function spreadChart(groups: readonly Group[], o: SpreadOptions): Chart;\nexport declare function histogramChart(values: readonly number[], o: ChartOptions & {\n    bins?: number;\n}): Chart;\nexport type CalendarOptions = ChartOptions & {\n    ramp?: (t: number) => string;\n};\nexport declare function calendar(data: {\n    start: number;\n    values: readonly number[];\n}, o: CalendarOptions): Chart;\nexport type Task = {\n    label: string;\n    start: number;\n    end: number;\n    done?: number;\n    group?: number;\n    milestone?: boolean;\n};\nexport declare function gantt(tasks: readonly Task[], o: ChartOptions & {\n    today?: number;\n}): Chart;\nexport type Series = {\n    name: string;\n    values: readonly number[];\n};\nexport declare function stream(labels: readonly string[], layers: readonly Series[], o: ChartOptions & {\n    offset?: StreamOffset;\n}): Chart;\nexport declare function controlChart(values0: readonly number[], labels0: readonly string[], o: ChartOptions & {\n    ranges?: boolean;\n}): Chart;\nexport type Item = {\n    label: string;\n    value: number;\n};\nexport declare function lollipop(items: readonly Item[], o: ChartOptions & {\n    sort?: boolean;\n}): Chart;\nexport type Pair = {\n    label: string;\n    a: number;\n    b: number;\n};\nexport declare function dumbbell(rows: readonly Pair[], o: ChartOptions & {\n    names?: [\n        string,\n        string\n    ];\n    sort?: boolean;\n}): Chart;\nexport declare function radar(axes: readonly string[], series: readonly Series[], o: ChartOptions & {\n    max?: number;\n}): Chart;\nexport declare function radialBar(items: readonly Item[], o: ChartOptions & {\n    max?: number;\n}): Chart;\nexport declare function rose(categories: readonly string[], series: readonly Series[], o: ChartOptions): Chart;\nexport declare function pareto(items: readonly Item[], o: ChartOptions & {\n    cut?: number;\n}): Chart;\nexport declare function tableHtml(t: DataTable, cls?: string): string;\nexport declare function tableCsv(t: DataTable): string;"
        },
        {
          "file": "explore.ts",
          "declarations": "export type ExploreAt = {\n    k: number;\n    say: string;\n    el: SVGElement;\n    x: number;\n    y: number;\n    via: 'pointer' | 'key';\n};\nexport declare function explore(svg: SVGSVGElement, onMark?: (at: ExploreAt | null) => void, { live }?: {\n    live?: HTMLElement | null;\n}): () => void;"
        },
        {
          "file": "geometry.ts",
          "declarations": "export declare const dayOf: (y: number, m: number, d: number) => number;\nexport declare const weekday: (day: number) => number;\nexport declare function dayText(day: number, opts?: Intl.DateTimeFormatOptions): string;\nexport type CalendarCell = {\n    k: number;\n    day: number;\n    col: number;\n    row: number;\n};\nexport declare function calendarLayout(start: number, count: number): {\n    cells: CalendarCell[];\n    weeks: number;\n    months: {\n        col: number;\n        day: number;\n    }[];\n};\nexport type StreamOffset = 'wiggle' | 'silhouette' | 'zero';\nexport declare function stackStream(layers: readonly (readonly number[])[], offset?: StreamOffset): {\n    lower: number[][];\n    upper: number[][];\n    min: number;\n    max: number;\n};\nexport type TreeNode = {\n    label: string;\n    value?: number;\n    children?: TreeNode[];\n};\nexport declare const valueOf: (nd: TreeNode) => number;\nexport type Arc = {\n    node: TreeNode;\n    path: string[];\n    depth: number;\n    branch: number;\n    a0: number;\n    a1: number;\n    value: number;\n    parent: number;\n};\nexport declare function partition(root: TreeNode): {\n    arcs: Arc[];\n    depth: number;\n    total: number;\n};\nexport declare const polar: (cx: number, cy: number, r: number, a: number) => [\n    number,\n    number\n];\nexport declare function arcPath(cx: number, cy: number, r0: number, r1: number, a0: number, a1: number): string;\nexport declare function arcLine(cx: number, cy: number, r: number, a0: number, a1: number): string;\nexport declare function easedPath(pts: readonly (readonly [\n    number,\n    number\n])[], move?: boolean): string;"
        },
        {
          "file": "periods.ts",
          "declarations": "export type Period = 'month' | 'week' | 'day';\nexport declare const PERIODS: readonly Period[];\nexport declare function periodStart(day: number, per: Period): number;\nexport declare function periodsSpanned(first: number, last: number, per: Period): number;\nexport declare function countPeriods(days: Iterable<number>, per: Period): number;\nexport declare function periodFor(periods?: (per: Period) => number | null): Period;\nexport declare function periodForDays(days: Iterable<number>): Period;\nexport declare function periodChoice(chosen: Period | null | undefined, days: Iterable<number>): {\n    per: Period;\n    auto: boolean;\n};\nexport type Bucketed = {\n    starts: number[];\n    values: number[];\n    counts: number[];\n    labels: string[];\n};\nexport declare function byPeriod(days: readonly number[], values: readonly number[], per: Period, { agg, fill }?: {\n    agg?: 'sum' | 'mean' | 'count';\n    fill?: boolean;\n}): Bucketed;\nexport declare function startsBetween(first: number, last: number, per: Period): number[];\nexport declare function periodText(start: number, per: Period): string;\nexport declare const perWords: (per: Period, { ly }?: {\n    ly?: boolean | undefined;\n}) => string;\nexport declare const perTitle: (subject: string, per: Period) => string;\nexport declare function retitle(title: string, per: Period): string;"
        }
      ],
      "pitfalls": [
        "Import charts.base.css before charts.css",
        "Draw each chart at the size it is shown and redraw when its box changes (a ResizeObserver)",
        "The series colours are --mc-c1 to --mc-c6, set for a light background",
        "The tinted fills use color-mix()",
        "A waffle rounds to whole hundredths by largest remainders, so it always shows 100 squares",
        "A control chart needs one value a period, in time order",
        "explore() makes the chart one Tab stop and owns the arrow keys while it has focus",
        "Every chart also returns its numbers as a table",
        "periodFor counts calendar periods touched, not their length",
        "An average per period (agg: “mean”) leaves out the periods with no values, even with fill",
        "Once a person picks a period, keep it (periodChoice with their choice)",
        "retitle swaps only the words per/a/each/by day, week or month, and daily, weekly or monthly",
        "The draw-in is CSS animation on the marks"
      ],
      "card": "entries/more-chart-types.json"
    },
    {
      "id": "names-wall",
      "aliases": [],
      "name": "Names wall into one line",
      "summary": "A wall of words that becomes one line. The words fill the frame in justified rows, written in one after another; then every word multiplies and flies into the line, whose letters are cut from a fabric of all of them, readable inside the letters and faint round them; then the line holds while light sweeps across it. Five ways to travel (a flock on curves, noise that is denoised step by step, threads that light up, a turning cloud, and a plain crossfade for reduced motion) and three looks (light, gold, a bevelled relief). Thousands of SDF glyphs in one instanced draw, the line’s shape a distance field too, and every frame a closed form of three progress values, so it scrubs backwards exactly.",
      "category": "technique",
      "role": "hero-visual",
      "stack": [
        "three",
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "text",
        "typography",
        "sdf",
        "glyph atlas",
        "distance field",
        "instancing",
        "storage buffers",
        "morph",
        "tagline",
        "title sequence",
        "scrubbable",
        "reduced motion",
        "tsl",
        "three.js"
      ],
      "useCases": [
        "a closing moment at an event: everyone’s name, then the line they make together",
        "a title sequence where a list (sponsors, features, contributors) resolves into a slogan",
        "a launch or a thank-you screen",
        "a scrubbable sequence in a presentation or a show timeline",
        "any list of words that should become one statement"
      ],
      "interaction": "Pause and scrub the timeline · Style cycles how they move · edit the line in Controls",
      "kits": [],
      "pairsWith": [
        {
          "id": "glyph-rivers",
          "why": "Another way to pour letters into a word"
        },
        {
          "id": "word-swarm",
          "why": "A swarm that writes the next line"
        },
        {
          "id": "cue-console",
          "why": "Run it as a cue in a show"
        }
      ],
      "variants": [],
      "version": "1.1.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-17",
          "gpuMs": 0.383,
          "cpuMs": 0.248,
          "cpuP95Ms": 0.39,
          "badge": "light",
          "drawCalls": 8,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.525,
            "p99Ms": 6.18,
            "low1Fps": 155.1
          },
          "notes": "Measured playing the whole timeline on a loop (wall, flight, hold) in the Flock style with the Light look: 48 words, about 4,000 glyphs in one instanced draw, the line’s rim and glow, and the backdrop under the veil."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 3.08,
          "cpuMs": 0.825,
          "cpuP95Ms": 0.99,
          "badge": "heavy",
          "drawCalls": 8,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 555 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 1.801,
          "cpuMs": 0.32,
          "cpuP95Ms": 0.46,
          "badge": "moderate",
          "drawCalls": 8,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 782 ms."
        }
      ],
      "signatures": [
        {
          "file": "names-wall.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { shuffled, type Shaped } from './wall-layout';\nexport declare const NAMES_WALL_STYLES: readonly [\n    \"flock\",\n    \"diffusion\",\n    \"threads\",\n    \"cloud\",\n    \"fade\"\n];\nexport type NamesWallStyle = (typeof NAMES_WALL_STYLES)[number];\nexport declare const NAMES_WALL_LOOKS: readonly [\n    \"light\",\n    \"gold\",\n    \"relief\"\n];\nexport type NamesWallLook = (typeof NAMES_WALL_LOOKS)[number];\nexport type NamesWallContent = {\n    words: readonly string[];\n    tagline: string;\n    subline?: string;\n    aspect: number;\n};\nexport type NamesWallProgress = {\n    names: number;\n    morph: number;\n    hold: number;\n};\nexport type NamesWallOptions = {\n    family?: string;\n    capacity?: number;\n    maskWidth?: number;\n};\nexport declare class NamesWall {\n    readonly object3D: THREE.Group<THREE.Object3DEventMap>;\n    style: NamesWallStyle;\n    look: NamesWallLook;\n    veil: number;\n    ghost: number;\n    stats: {\n        glyphs: number;\n        slots: number;\n        words: number;\n        clipped: boolean;\n    };\n    static create(options?: NamesWallOptions): Promise<NamesWall>;\n    set(content: NamesWallContent): typeof this.stats;\n    fit(camera: THREE.PerspectiveCamera, distance?: number, scale?: number, shiftY?: number): void;\n    update(progress: NamesWallProgress, time: number): void;\n    dispose(): void;\n}\nexport type { Shaped };\nexport { shuffled };"
        }
      ],
      "pitfalls": [
        "Load the font’s three weights (300, 500, 700) before create()",
        "Call set() when the words, the line or the frame’s aspect change, never every frame",
        "The materials are made once and refilled",
        "The glyph count grows with the line’s size and the number of words",
        "Every value is a closed form of names, morph and hold, so jumping or scrubbing back is exact",
        "Reduced motion: use the fade style",
        "On WebGPU the glyphs read eight storage buffers in the vertex stage, the default limit",
        "The wall stands in front of the lens (fit) and draws with depth testing off"
      ],
      "card": "entries/names-wall.json"
    },
    {
      "id": "noren-banners",
      "aliases": [],
      "name": "Noren curtain and vertical banners",
      "summary": "Two hangings in ink and cloth. A noren is a split curtain over a doorway: hover or focus parts it a little, the pointer brushes its panels, and going through flings them aside on springs while one print runs across every panel. A vertical banner drops open like a weighted scroll, bounces on its length and sways, its words running down the cloth in vertical writing mode and shrinking to fit, a seal at the foot. DOM and CSS, real text, rest when still.",
      "category": "ui",
      "role": "hero-visual",
      "stack": [
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "noren",
        "curtain",
        "banner",
        "hanging scroll",
        "vertical text",
        "writing-mode",
        "springs",
        "swing",
        "section entrance",
        "tabs",
        "reduced motion",
        "dom",
        "css",
        "no dependencies"
      ],
      "useCases": [
        "entering a section or a room of an app",
        "tabs with a sense of place",
        "calm, crafted or seasonal looks",
        "announcements down the side of a page",
        "event and opening-hours banners",
        "titles in vertical writing (CJK as well)"
      ],
      "interaction": "Go through a doorway (click, or Tab and Enter) · brush the curtains with the pointer",
      "kits": [],
      "pairsWith": [
        {
          "id": "textile-frames",
          "why": "Woven borders in the same cloth language"
        },
        {
          "id": "micro-interactions",
          "why": "Small springy moments beside the curtain"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "strength",
          "in": "module",
          "values": {
            "strict": 12,
            "refined": 24,
            "playful": 40
          },
          "note": "degrees the panels swing aside (default 32)"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.623,
            "p99Ms": 18.22,
            "low1Fps": 54
          },
          "notes": "Measured going through a doorway every 1.4 s (the curtain parts, holds and swings back to rest), with a gust every few seconds and the two banners rolled up and dropped open again every 5 s, so the frames hold the springs, the print sliding with each panel, and the banners’ drop, bounce and sway. At rest nothing runs."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 42 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.02,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 161 ms."
        }
      ],
      "signatures": [
        {
          "file": "banner.ts",
          "declarations": "import { type DropOptions, type SwingOptions } from './cloth';\nexport type BannerOptions = {\n    text: string;\n    sub?: string;\n    seal?: string | false;\n    upright?: boolean;\n    open?: boolean;\n    drop?: DropOptions;\n    swing?: SwingOptions;\n    breeze?: boolean;\n    reducedMotion?: () => boolean;\n};\nexport type Banner = {\n    unroll(): Promise<void>;\n    rollUp(): Promise<void>;\n    readonly open: boolean;\n    setText(text: string, sub?: string, seal?: string | false): void;\n    gust(power?: number, dir?: number): void;\n    fit(): void;\n    dispose(): void;\n};\nexport declare function verticalBanner(host: HTMLElement, options: BannerOptions): Banner;"
        },
        {
          "file": "noren.ts",
          "declarations": "import { type SwingOptions } from './cloth';\nexport type NorenOptions = {\n    text: string;\n    panels?: number;\n    strength?: number;\n    peek?: number;\n    hold?: number;\n    swing?: SwingOptions;\n    breeze?: boolean;\n    reducedMotion?: () => boolean;\n    onEnter?: () => void;\n};\nexport type Noren = {\n    part(from?: number): void;\n    gust(power?: number, dir?: number): void;\n    setText(text: string): void;\n    readonly moving: boolean;\n    dispose(): void;\n};\nexport declare function noren(door: HTMLElement, options: NorenOptions): Noren;"
        }
      ],
      "pitfalls": [
        "The noren is decoration inside the doorway (aria-hidden)",
        "Going through calls onEnter at once, before the curtain has parted",
        "The door must be positioned and should not clip its top",
        "The print is one line across all the panels, so keep it short (a word or two)",
        "Vertical text in Latin runs sideways (writing-mode: vertical-rl) and reads top to bottom",
        "A banner fits its words by measuring them, so give its host a size",
        "Breeze keeps a frame loop running for as long as it is on",
        "Under reduced motion nothing swings"
      ],
      "card": "entries/noren-banners.json"
    },
    {
      "id": "offline-narrator",
      "aliases": [],
      "name": "Offline narrator",
      "summary": "Narration from a script with no cloud: lines with pauses and tone marks, a pronunciation list and {values}, parsed into pieces that keep their place in the script, so the word being said lights up in the editor. One line is spoken at a time; another take reads it a little differently; every clip is named by the engine, voice, recording, settings and words, so an unchanged line is never made twice. In the page it speaks with the system’s own voices (Web Speech); on a Node server it makes WAV files with Kokoro on the CPU or Chatterbox on the graphics card, which can copy a voice from a recording, written atomically.",
      "category": "systems",
      "role": "system",
      "stack": [
        "headless"
      ],
      "character": "calm",
      "tags": [
        "text to speech",
        "narration",
        "voice",
        "web speech",
        "speech synthesis",
        "offline",
        "kokoro",
        "chatterbox",
        "voice cloning",
        "pronunciation",
        "cache",
        "queue",
        "wav",
        "node",
        "accessibility",
        "keyboard",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "narration for a presentation, a tour or a walkthrough",
        "voice-over drafts before a real recording",
        "reading a script aloud while writing it",
        "kiosks and exhibits that must run without a network",
        "spoken prompts in a game or a tutorial",
        "clips made once on a build machine and played anywhere"
      ],
      "interaction": "Edit the script, insert marks, pick a voice · Play script or Ctrl Enter on a line · Another take, then keep one · Esc stops",
      "kits": [],
      "pairsWith": [
        {
          "id": "audio-engine",
          "why": "Music that ducks under the voice"
        },
        {
          "id": "slide-show-player",
          "why": "Narrate each slide"
        },
        {
          "id": "cue-console",
          "why": "Lines as cues"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the demo exercising itself: the five-line script plays on a loop through the silent timing engine (the bench has no click, so the system voice may not speak), with the word pill moving in the editor and the reading view, the ribbon pulsing on each word, the pause rings and the timeline playhead. Parsing and highlighting run on each edit, not each frame."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 164 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 86 ms."
        }
      ],
      "signatures": [
        {
          "file": "narrator.ts",
          "declarations": "import { ClipCache, type CachedClip } from './cache';\nimport { JobQueue } from './queue';\nimport { type Piece, type Pronunciation, type Tone, type Values } from './script';\nexport type NarratorVoice = {\n    id: string;\n    name: string;\n    lang: string;\n    engine: string;\n    local: boolean;\n    default?: boolean;\n    stamp?: string;\n    note?: string;\n};\nexport type SpeakRequest = {\n    text: string;\n    tone: Tone;\n    voice: string;\n    rate: number;\n    take: number;\n    signal: AbortSignal;\n    onStart?(): void;\n    onWord?(from: number, to: number, estimated: boolean): void;\n};\nexport interface LiveEngine {\n    readonly id: string;\n    readonly version: string;\n    readonly takes: boolean;\n    voices(): Promise<NarratorVoice[]>;\n    speak(request: SpeakRequest): Promise<void>;\n    dispose?(): void;\n}\nexport type LiveClip = {\n    words: number;\n    estimated: boolean;\n    voice: string;\n};\nexport type LineRequest = {\n    voice: string;\n    rate?: number;\n    take?: number;\n    tone?: Tone;\n    say?: readonly Pronunciation[];\n    values?: Values;\n    offset?: number;\n    label?: string;\n};\nexport type LinePlan = {\n    pieces: Piece[];\n    key: string;\n    group: string;\n    hash: string;\n    take: number;\n    seconds: number;\n    known: CachedClip<LiveClip> | undefined;\n};\nexport type NarratorEvent = {\n    type: 'line';\n    label: string;\n    plan: LinePlan;\n} | {\n    type: 'piece';\n    label: string;\n    index: number;\n    piece: Piece;\n} | {\n    type: 'word';\n    label: string;\n    from: number;\n    to: number;\n    estimated: boolean;\n} | {\n    type: 'pause';\n    label: string;\n    seconds: number;\n    from: number;\n    to: number;\n} | {\n    type: 'end';\n    label: string;\n    plan: LinePlan;\n    seconds: number;\n    clip: CachedClip<LiveClip>;\n} | {\n    type: 'stop';\n    label: string;\n} | {\n    type: 'error';\n    label: string;\n    error: Error;\n};\nexport type NarratorOptions = {\n    engine: LiveEngine;\n    cache?: ClipCache<LiveClip>;\n    breath?: number;\n    clock?: () => number;\n    wait?: (ms: number, signal: AbortSignal) => Promise<void>;\n};\nexport type Narrator = ReturnType<typeof createNarrator>;\nexport declare function createNarrator(options: NarratorOptions): {\n    cache: ClipCache<LiveClip>;\n    queue: JobQueue<string>;\n    readonly engine: LiveEngine;\n    plan: (text: string, req: LineRequest) => LinePlan;\n    play(text: string, req: LineRequest): Promise<{\n        plan: LinePlan;\n        seconds: number;\n        clip: CachedClip<LiveClip>;\n    }>;\n    stop(): void;\n    setBreath(seconds: number): void;\n    setEngine(next: LiveEngine): void;\n    on(fn: (e: NarratorEvent) => void): () => boolean;\n    dispose(): void;\n};\nexport declare function wordsOf(text: string): Array<{\n    from: number;\n    to: number;\n}>;\nexport declare function wordTimes(text: string, cps: number): Array<{\n    from: number;\n    to: number;\n    at: number;\n}>;"
        },
        {
          "file": "script.ts",
          "declarations": "export type Tone = 'calm' | 'natural' | 'lively' | 'excited';\nexport declare const TONES: readonly Tone[];\nexport declare const DELIVERY: Readonly<Record<Tone, {\n    expressive: number;\n    pace: number;\n    speed: number;\n    pitch: number;\n}>>;\nexport declare const PAUSE: {\n    readonly min: 0.1;\n    readonly max: 5;\n    readonly default: 0.6;\n};\nexport declare const MARK: RegExp;\nexport type Pronunciation = {\n    word: string;\n    say: string;\n};\nexport type Values = Readonly<Record<string, string | number>>;\nexport type Run = {\n    outFrom: number;\n    outTo: number;\n    srcFrom: number;\n    srcTo: number;\n    same: boolean;\n};\nexport type SayPiece = {\n    kind: 'say';\n    text: string;\n    tone: Tone;\n    from: number;\n    to: number;\n    runs: Run[];\n};\nexport type PausePiece = {\n    kind: 'pause';\n    seconds: number;\n    from: number;\n    to: number;\n};\nexport type Piece = SayPiece | PausePiece;\nexport type LineOptions = {\n    tone?: Tone;\n    say?: readonly Pronunciation[];\n    values?: Values;\n    offset?: number;\n};\nexport declare function parseLine(text: string, options?: LineOptions): Piece[];\nexport declare function pieces(text: string, tone?: Tone, options?: Omit<LineOptions, 'tone' | 'offset'>): ({\n    say: string;\n    tone: Tone;\n    pause?: undefined;\n} | {\n    pause: number;\n    say?: undefined;\n    tone?: undefined;\n})[];\nexport type ScriptLine = {\n    index: number;\n    number: number;\n    from: number;\n    to: number;\n    text: string;\n};\nexport declare function parseScript(script: string): ScriptLine[];\nexport declare function canonical(parts: readonly Piece[]): string;\nexport declare function estimateSeconds(parts: readonly Piece[], rate?: number, options?: {\n    cps?: number;\n    breath?: number;\n}): number;\nexport declare function parsePronunciations(text: string): Pronunciation[];\nexport declare const formatPronunciations: (list: readonly Pronunciation[]) => string;\ntype Edit = {\n    from: number;\n    to: number;\n    insert: string;\n};\nexport declare function mapBack(runs: readonly Run[], i: number, bias?: 'start' | 'end'): number;\nexport declare function pronunciationMatches(text: string, list: readonly Pronunciation[]): Array<Edit & {\n    word: string;\n}>;\nexport declare function respell(text: string, list?: readonly Pronunciation[], values?: Values): {\n    text: string;\n    runs: Run[];\n};\nexport declare function sourceRange(piece: SayPiece, from: number, to: number): {\n    from: number;\n    to: number;\n};\nexport declare function wordLength(text: string, i: number): number;\nexport type TokenKind = 'pause' | 'tone' | 'unknown' | 'value' | 'missing-value' | 'respelled' | 'comment';\nexport type Token = {\n    kind: TokenKind;\n    from: number;\n    to: number;\n    tone?: Tone;\n    seconds?: number;\n    say?: string;\n};\nexport declare function highlight(script: string, options?: {\n    say?: readonly Pronunciation[];\n    values?: Values;\n}): Token[];\nexport {};"
        },
        {
          "file": "voice-service.ts",
          "declarations": "import type { NarratorVoice } from './narrator';\nimport { JobQueue } from './queue';\nimport { type RenderEngine } from './render';\nimport { type Pronunciation, type Tone, type Values } from './script';\nexport type FsLike = {\n    existsSync(path: string): boolean;\n    mkdirSync(path: string, options: {\n        recursive: true;\n    }): unknown;\n    readdirSync(path: string): string[];\n    readFileSync(path: string): Uint8Array;\n    writeFileSync(path: string, data: Uint8Array): void;\n    renameSync(from: string, to: string): void;\n    unlinkSync(path: string): void;\n    statSync(path: string): {\n        size: number;\n        mtimeMs: number;\n    };\n    openSync(path: string, flags: 'r'): number;\n    readSync(fd: number, buffer: Uint8Array, offset: number, length: number, position: number): number;\n    closeSync(fd: number): void;\n};\nexport type PathLike = {\n    join(...parts: string[]): string;\n    dirname(path: string): string;\n};\ntype Stream = {\n    setEncoding?(encoding: 'utf8'): unknown;\n    on(event: 'data', listener: (chunk: string) => void): unknown;\n};\nexport type ChildLike = {\n    stdin: {\n        write(line: string): unknown;\n    } | null;\n    stdout: Stream | null;\n    stderr: Stream | null;\n    exitCode: number | null;\n    on(event: 'exit', listener: (code: number | null) => void): unknown;\n    kill(): unknown;\n};\nexport type SpawnLike = (command: string, args: string[], options: {\n    cwd?: string;\n    env?: Record<string, string | undefined>;\n    windowsHide?: boolean;\n}) => ChildLike;\nexport type NodeHost = {\n    fs: FsLike;\n    path: PathLike;\n    spawn?: SpawnLike;\n    env?: Record<string, string | undefined>;\n};\nexport declare const statusError: (message: string, status: number) => Error & {\n    status: number;\n};\nexport declare function writeAtomic(host: NodeHost, file: string, data: Uint8Array): void;\nexport type KokoroModel = {\n    generate(text: string, options: {\n        voice: string;\n        speed: number;\n    }): Promise<{\n        audio: ArrayLike<number>;\n        sampling_rate: number;\n    }>;\n};\nexport declare function kokoroVoice(id: string, grade?: string): NarratorVoice;\nexport type KokoroOptions = {\n    load: () => Promise<KokoroModel>;\n    voices: string[] | {\n        dir: string;\n    };\n    grades?: Record<string, string>;\n    version?: string;\n};\nexport declare function kokoroEngine(host: NodeHost, options: KokoroOptions): RenderEngine;\nexport type ChatterboxOptions = {\n    python: string;\n    worker: string;\n    hfHome: string;\n    refs: string;\n    cwd?: string;\n    version?: string;\n};\nexport declare function chatterboxEngine(host: NodeHost, options: ChatterboxOptions): RenderEngine & {\n    installed(): boolean;\n    refs(): Array<{\n        name: string;\n        file: string;\n    }>;\n    addRef(name: string, data: Uint8Array, ext?: string): {\n        id: string;\n        name: string;\n    };\n    removeRef(name: string): {\n        removed: boolean;\n    };\n};\nexport type MakeRequest = {\n    dir: string;\n    folder?: string;\n    text: string;\n    voice: string;\n    speed?: number;\n    take?: number;\n    tone?: Tone;\n    say?: readonly Pronunciation[];\n    values?: Values;\n};\nexport type MadeClip = {\n    path: string;\n    file: string;\n    seconds: number;\n    bytes: number;\n    cached: boolean;\n    voice: string;\n    model: string;\n    hash: string;\n};\nexport declare function createVoiceService(host: NodeHost, options: {\n    engines: RenderEngine[];\n    maxChars?: number;\n    breath?: number;\n}): {\n    queue: JobQueue<string>;\n    voices: () => NarratorVoice[];\n    name: (req: MakeRequest) => {\n        hash: string;\n        key: string;\n        group: string;\n        engine: RenderEngine;\n        speed: number;\n        take: number;\n    };\n    make(req: MakeRequest): Promise<MadeClip>;\n    close(): void;\n};\nexport {};"
        },
        {
          "file": "web-speech.ts",
          "declarations": "import { type LiveEngine } from './narrator';\nexport type WebSpeechOptions = {\n    synth?: SpeechSynthesis;\n    Utterance?: typeof SpeechSynthesisUtterance;\n    localOnly?: boolean;\n    maxChars?: number;\n    cps?: number;\n    voiceWait?: number;\n};\nexport declare function takeVariation(take: number): {\n    pitch: number;\n    rate: number;\n};\nexport declare function chunks(text: string, max: number): Array<{\n    text: string;\n    at: number;\n}>;\nexport declare function createWebSpeechEngine(options?: WebSpeechOptions): LiveEngine & {\n    supported: boolean;\n    cancel(): void;\n    watch(fn: () => void): () => void;\n};\nexport declare function createSilentEngine(options?: {\n    cps?: number;\n    wait?: (ms: number, signal: AbortSignal) => Promise<void>;\n}): LiveEngine;"
        }
      ],
      "pitfalls": [
        "A copied voice needs the speaker’s consent, in writing, for the use you make of it",
        "Not every system voice is offline",
        "The voice list fills after the page loads (Chrome fires voiceschanged; some browsers don’t)",
        "Some voices give no word boundary events (several online ones, some on Android)",
        "Chrome loses an utterance’s events if nothing holds a reference to it",
        "A live engine can’t hand back its audio",
        "The clip key has the engine’s version, the voice, the recording’s stamp",
        "Pronunciations match whole words, case-sensitively, longest first",
        "Kokoro takes about as long as the line lasts on a laptop CPU",
        "The voice service names Node’s modules as inputs (fs, path, spawn)"
      ],
      "card": "entries/offline-narrator.json"
    },
    {
      "id": "offline-sync",
      "aliases": [],
      "name": "Offline sync",
      "summary": "Shared lists that keep working with no signal. Every change shows at once and waits in a saved queue until the server confirms it; a client that comes back catches up with only what changed since the version it last saw, with its own pending edits kept on top; deletes are kept 30 days as tombstones, and a client away longer is sent everything again. The server stamps who did what from the connection, keeps votes as documents of their own, and merges field by field, the last write to arrive winning. A pure, tested client engine with storage and transport injected, the server logic with no framework, an in-memory network for tests and rehearsals, and a thin Cloudflare Worker and Durable Object adapter.",
      "category": "systems",
      "role": "system",
      "stack": [
        "headless"
      ],
      "character": "calm",
      "tags": [
        "offline first",
        "sync",
        "optimistic updates",
        "outbox",
        "queue",
        "catch-up",
        "versions",
        "tombstones",
        "last write wins",
        "field-level merge",
        "WebSocket",
        "reconnect",
        "back-off",
        "Cloudflare Workers",
        "Durable Objects",
        "SQLite",
        "hibernation",
        "votes",
        "localStorage",
        "useSyncExternalStore",
        "live region",
        "accessibility",
        "keyboard",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "lists used where the signal comes and goes",
        "live updates on every phone in a small team",
        "edits that survive a closed app",
        "votes cast at once without overwriting",
        "a tiny backend on one Durable Object",
        "testing sync without a network"
      ],
      "interaction": "Switch a phone off, edit on two phones, switch them back · or try a scenario above the phones",
      "kits": [
        {
          "kit": "dashboard",
          "as": "optional"
        },
        {
          "kit": "shop",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "list-smarts",
          "why": "Lists that learn the walk and sync offline"
        },
        {
          "id": "phone-app-shell",
          "why": "An installable app that keeps working offline"
        },
        {
          "id": "sealed-relay",
          "why": "End-to-end encryption over the relay"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the demo running its three scenarios in a loop at a 60 ms network delay: phones going offline and back, edits queued and merged, a delete reaching a phone that was away, a month skipped and a full resend. The server, the network and three sync engines all run in the page; the phones re-render on every change. Nothing runs between changes outside the bench."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 44 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.02,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 101 ms."
        }
      ],
      "signatures": [
        {
          "file": "browser.ts",
          "declarations": "import type { SyncStorage, Transport } from './client';\nexport declare const sameOriginSocket: (path?: string) => string;\nexport declare function webSocketTransport(url: string | (() => string)): Transport;\nexport declare function localStorageCache(key: string): SyncStorage;\nexport declare function wakeOnReturn(sync: {\n    wake(): void;\n}): () => void;"
        },
        {
          "file": "client.ts",
          "declarations": "import { type Data, type Who } from './protocol';\nexport type Status = 'offline' | 'connecting' | 'online' | 'denied';\nexport type Docs = Record<string, Record<string, Data>>;\nexport type Snapshot = {\n    docs: Docs;\n    status: Status;\n    pending: number;\n    waiting: Record<string, string[]>;\n    v: number;\n    loaded: boolean;\n};\nexport type Op = {\n    op: string;\n    kind: string;\n    id: string;\n    patch: Data;\n};\nexport interface Connection {\n    send(text: string): void;\n    close(): void;\n}\nexport interface Transport {\n    open(handlers: {\n        open(): void;\n        message(text: string): void;\n        close(): void;\n    }): Connection;\n}\nexport interface SyncStorage {\n    read(): string | null;\n    write(text: string): void;\n}\nexport interface Timers {\n    set(fn: () => void, ms: number): unknown;\n    clear(handle: unknown): void;\n}\nexport declare const realTimers: Timers;\nexport type SyncEvent = {\n    type: 'status';\n    status: Status;\n} | {\n    type: 'welcome';\n    since: number;\n    v: number;\n    reset: boolean;\n    docs: number;\n    resent: number;\n} | {\n    type: 'remote';\n    kind: string;\n    id: string;\n    data: Data | undefined;\n    before: Data | undefined;\n    by?: string;\n} | {\n    type: 'queued';\n    op: Op;\n    sent: boolean;\n} | {\n    type: 'confirmed';\n    op: Op;\n} | {\n    type: 'refused';\n    op: Op;\n};\nexport type SyncOptions = {\n    transport: Transport;\n    who?: Who;\n    auth?: string;\n    storage?: SyncStorage;\n    timers?: Timers;\n    now?: () => number;\n    newId?: () => string;\n    saveDelay?: number;\n    retry?: {\n        first: number;\n        max: number;\n    };\n    ping?: {\n        every: number;\n        silent: number;\n    };\n};\nexport declare const docKey: (kind: string, id: string) => string;\nexport declare function createSync<T extends Record<string, Data> = Record<string, Data>>(o: SyncOptions): {\n    get: () => Snapshot;\n    subscribe(listener: () => void): () => undefined;\n    on(listener: (e: SyncEvent) => void): () => undefined;\n    start: (hello?: {\n        who: Who;\n        auth?: string;\n    }) => void;\n    stop: () => void;\n    wake(): void;\n    put: <K extends keyof T & string>(kind: K, id: string, patch: Partial<T[K]>) => string;\n    remove: <K extends keyof T & string>(kind: K, id: string) => string;\n    list: <K extends keyof T & string>(kind: K) => Array<T[K] & {\n        id: string;\n    }>;\n    waiting: (kind: string, id: string) => string[];\n    flush: () => void;\n    dispose(): void;\n};\nexport type Sync<T extends Record<string, Data> = Record<string, Data>> = ReturnType<typeof createSync<T>>;"
        },
        {
          "file": "loopback.ts",
          "declarations": "import { type Timers, type Transport } from './client';\nimport type { Peer } from './server';\nexport type WireEvent = {\n    type: 'send';\n    id: number;\n    link: string;\n    dir: 'up' | 'down';\n    text: string;\n    ms: number;\n} | {\n    type: 'arrive';\n    id: number;\n} | {\n    type: 'lost';\n    id: number;\n} | {\n    type: 'link';\n    link: string;\n    online: boolean;\n};\ntype ServerSide = {\n    message(peer: Peer, text: string): unknown;\n};\nexport type LoopLink = {\n    readonly name: string;\n    readonly transport: Transport;\n    setOnline(on: boolean): void;\n    readonly online: boolean;\n    readonly connected: boolean;\n};\nexport declare function createLoopback(o?: {\n    latency?: number;\n    timers?: Timers;\n    on?: (e: WireEvent) => void;\n}): {\n    peers: () => Peer[];\n    attach(s: ServerSide): void;\n    link: (name: string) => LoopLink;\n    setLatency(ms: number): void;\n};\nexport type Loopback = ReturnType<typeof createLoopback>;\nexport {};"
        },
        {
          "file": "server.ts",
          "declarations": "import { type Data, type Doc, type Who } from './protocol';\nexport type Row = {\n    kind: string;\n    id: string;\n    v: number;\n    data: Data;\n    gone: number | null;\n    op: string | null;\n};\nexport interface DocStore {\n    get(kind: string, id: string): Row | undefined;\n    put(row: Row): void;\n    changedSince(v: number): Row[];\n    live(): Row[];\n    forget(goneBefore: number): Array<Pick<Row, 'kind' | 'id' | 'v'>>;\n    dropWhere(kind: string, field: string, values: string[]): void;\n    meta(key: string): number;\n    setMeta(key: string, n: number): void;\n}\nexport interface Peer {\n    who(): Who | null;\n    setWho(who: Who | null): void;\n    send(text: string): void;\n    close(code: number, reason: string): void;\n}\nexport type PutRequest = {\n    kind: string;\n    id: string;\n    patch: Data;\n    before: Data | undefined;\n    who: Who;\n    now: number;\n};\nexport type Rule = (put: PutRequest) => Data | null;\nexport declare const rules: {\n    shared: () => Rule;\n    author: () => Rule;\n    vote: (field?: string) => Rule;\n    fields: (names: string[], rule?: Rule) => Rule;\n    none: () => Rule;\n};\nexport type ServerEvent = {\n    type: 'welcome';\n    who: Who;\n    since: number;\n    reset: boolean;\n    docs: number;\n    v: number;\n} | {\n    type: 'write';\n    kind: string;\n    id: string;\n    v: number;\n    before: Data | undefined;\n    data: Data;\n    patch: Data;\n    who: Who | null;\n} | {\n    type: 'refused';\n    who: Who;\n    kind: string;\n    id: string;\n} | {\n    type: 'denied';\n    who: Who;\n} | {\n    type: 'forget';\n    count: number;\n    below: number;\n};\nexport type SyncServerOptions = {\n    store: DocStore;\n    peers(): Peer[];\n    rules: Record<string, Rule>;\n    authorise(hello: {\n        who: Who;\n        auth: string;\n    }): Who | null | Promise<Who | null>;\n    keepDeleted?: number;\n    children?: Array<{\n        kind: string;\n        field: string;\n        parent: string;\n    }>;\n    seed?: Doc[];\n    now?: () => number;\n    on?: (e: ServerEvent, server: {\n        write(kind: string, id: string, patch: Data): void;\n        get(kind: string, id: string): Data | undefined;\n    }) => void;\n    maxFailures?: number;\n};\nexport declare const DAY = 86400000;\nexport declare const KEEP_DELETED: number;\nexport declare function sameCode(given: string, want: string): boolean;\nexport declare function createSyncServer(o: SyncServerOptions): {\n    message(peer: Peer, text: string): Promise<void>;\n    write: (kind: string, id: string, patch: Data) => Row;\n    purge: (at?: number) => number;\n    get: (kind: string, id: string) => Data | undefined;\n    version: () => number;\n};\nexport type SyncServer = ReturnType<typeof createSyncServer>;\nexport declare function memoryStore(): DocStore & {\n    rows: Map<string, Row>;\n};"
        }
      ],
      "pitfalls": [
        "“Last write wins” means the last write to reach the server, field by field",
        "Deletes are tombstones (deleted: true) kept 30 days (keepDeleted)",
        "Who did something comes from the connection, never from the change",
        "A kind with no rule is refused, and the client rolls the change back",
        "Clear a field with null, not by leaving it out",
        "The saved copy is the whole state in one JSON string (localStorage by default, about 5 MB)",
        "Pings go every 20 s, and a connection with nothing heard for 45 s is dropped and made again",
        "One Durable Object holds everything here (fine for a small group: thousands of writes a second)",
        "The Worker adapter is reference code with typed stand-ins for the Workers APIs"
      ],
      "card": "entries/offline-sync.json"
    },
    {
      "id": "painted-chart-marks",
      "aliases": [],
      "name": "Painted chart marks (GPU)",
      "summary": "Bars and lines drawn as physical things in one instanced draw each: glass capsules of sloshing liquid, ferrofluid columns on a glowing copper magnet with chrome wires, swaying stems and vines, stamped ink and pencil, feather quills, poured paint and brush strokes, ink wash, or glass bars with eight patterns inside and light trails with a wall of light. Bars grow in one after another; lines draw themselves on, and run on from their end when points arrive. Linked charts light the same month together without echoing.",
      "category": "data",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "expressive",
      "tags": [
        "charts",
        "bar chart",
        "line chart",
        "instancing",
        "sdf",
        "wgsl",
        "tsl",
        "grow-in",
        "hover",
        "linked charts",
        "glow",
        "live data",
        "board"
      ],
      "useCases": [
        "dashboards with character",
        "hero figures on a landing page",
        "reports and year reviews",
        "games’ stats screens",
        "canvas and whiteboard apps",
        "live charts where points keep arriving",
        "linked charts and tables"
      ],
      "interaction": "Pick a look · hover or tap a month for its figures · Charts: Two, linked lights the month on both · Add a month runs the line on from its end · Tab to a chart and use the arrow keys",
      "kits": [],
      "pairsWith": [
        {
          "id": "quiet-charts",
          "why": "Plain charts beside the painted ones"
        },
        {
          "id": "chart-access",
          "why": "A table for every painted chart"
        },
        {
          "id": "css-locked-stage",
          "why": "Marks standing on the chart’s DOM boxes"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [
        {
          "name": "motion",
          "in": "module",
          "values": {
            "strict": false,
            "refined": false,
            "playful": true
          },
          "note": "ambient sway, slosh and growing in"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.80",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-04",
          "gpuMs": 0.041,
          "cpuMs": 0.2,
          "cpuP95Ms": 0.355,
          "badge": "light",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": null,
          "notes": "The default look (glass capsules and the glowing line) at rest, growing in again every 2.5 s while the highlight sweeps across the months."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.131,
          "cpuMs": 0.34,
          "cpuP95Ms": 0.47,
          "badge": "light",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 254 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 0.92,
          "cpuMs": 0.1,
          "cpuP95Ms": 0.24,
          "badge": "moderate",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 211 ms."
        }
      ],
      "signatures": [
        {
          "file": "chart-marks.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { type GlassSettings } from './glass';\nimport { type HoverEvent, type HoverSource } from './hover';\nimport { type Look } from './shade';\nexport { LOOKS, type Look } from './shade';\nexport { GLASS_DEFAULTS, GLASS_KNOBS, GLASS_PATTERNS, type GlassPattern, type GlassSettings } from './glass';\nexport type { HoverEvent, HoverSource } from './hover';\nexport type Bar = {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n    colour: string;\n    alpha?: number;\n    across?: boolean;\n    seed?: number;\n    track?: number;\n};\nexport type Line = {\n    points: readonly {\n        x: number;\n        y: number;\n    }[];\n    colour: string;\n    width?: number;\n    glow?: number;\n    seed?: number;\n    wall?: number;\n};\nexport type ChartMarksOptions = {\n    look?: Look;\n    grow?: number;\n    stagger?: number;\n    motion?: boolean;\n    dark?: boolean;\n    displayOutput?: boolean;\n    bars?: number;\n    segments?: number;\n    glass?: Partial<GlassSettings>;\n    onHover?: (event: HoverEvent) => void;\n};\nexport type SetOptions = {\n    instant?: boolean;\n    appended?: boolean;\n};\nexport declare class ChartMarks {\n    readonly group: THREE.Group<THREE.Object3DEventMap>;\n    readonly time: THREE.UniformNode<\"float\", number>;\n    readonly clock: THREE.UniformNode<\"float\", number>;\n    readonly unit: THREE.UniformNode<\"float\", number>;\n    stagger: number;\n    onHover: ((event: HoverEvent) => void) | null;\n    constructor(options?: ChartMarksOptions);\n    get look(): Look;\n    set look(look: Look);\n    get motion(): boolean;\n    set motion(on: boolean);\n    get dark(): boolean;\n    set dark(on: boolean);\n    get grow(): number;\n    set grow(s: number);\n    get growing(): boolean;\n    get glass(): GlassSettings;\n    setGlass(change: Partial<GlassSettings>): void;\n    get moving(): boolean;\n    set(owner: string, bars: readonly Bar[], lines?: readonly Line[], { instant, appended }?: SetOptions): void;\n    drop(owner: string): void;\n    replay(owner?: string): void;\n    hover(owner: string | null, index?: number, { source }?: {\n        source?: HoverSource;\n    }): void;\n    get hovered(): {\n        owner: string;\n        index: number;\n    } | null;\n    lit(owner: string): number;\n    link(owners: readonly string[]): void;\n    unlink(owner: string): void;\n    pick(x: number, y: number, slack?: number): {\n        owner: string;\n        index: number;\n    } | null;\n    compile(renderer: THREE.WebGPURenderer, camera: THREE.Camera, scene: THREE.Scene, looks?: readonly Look[]): Promise<void>;\n    update(dt: number, unit?: number): void;\n    dispose(): void;\n}"
        }
      ],
      "pitfalls": [
        "The looks are authored in display colour, as on a 2D canvas",
        "Each look is its own pair of shaders, built the first time it is used",
        "The quill shaders take derivatives (fwidth) to filter their barbs",
        "set() compares each owner’s marks with its last",
        "Halos, spikes, leaves and the pour reach past a bar’s rect (up to 30 px)",
        "three multiplies a premultipliedAlpha material’s colorNode by its opacity again",
        "A line given more points draws on from its old end only when its old points are exactly its…",
        "Two charts linked by the app (two instances, a chart and a table) must pass hover changes on…",
        "The camera is orthographic with y down (top < bottom), which mirrors the projection",
        "Text stays in the DOM: axis labels, the readout and a table of the figures",
        "moving is true while marks grow, a hover eases or ambient motion is on",
        "The demo needs WebGPU: every look is written in WGSL"
      ],
      "card": "entries/painted-chart-marks.json"
    },
    {
      "id": "panel-choreography",
      "aliases": [],
      "name": "Mechanical panel choreography",
      "summary": "On a screen change the old panels unbolt, unlatch and leave, and the new ones slide or swing in on their rails, hit a hard stop, ring back, latch and bolt home, staggered in reading order. Each panel is a small state stepped by time, so a change can be asked for again or reversed at any moment and every panel turns round from where it is. Cues for sounds and shakes, focus and inert handled, a fade under reduced motion.",
      "category": "ui",
      "role": "interaction",
      "stack": [
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "screen transitions",
        "choreography",
        "stagger",
        "interruptible",
        "reversible",
        "hard stop",
        "latch",
        "bolts",
        "hinge",
        "tabs",
        "reduced motion",
        "inert",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "switching the screens of a dashboard or a game menu",
        "tabs that rebuild a whole view",
        "mechanical, industrial or sci-fi looks",
        "onboarding steps",
        "a kiosk or control-room interface"
      ],
      "interaction": "Switch screens with the tabs or 1 2 3 · switch again mid-change to turn it round",
      "kits": [],
      "pairsWith": [
        {
          "id": "ui-sounds",
          "why": "Clunks and latches as panels seat"
        },
        {
          "id": "split-panes",
          "why": "The panels it brings in and out"
        },
        {
          "id": "impact-plates",
          "why": "The page jolts as a panel hits its stop"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "stagger",
          "in": "module",
          "values": {
            "strict": 0,
            "refined": 60,
            "playful": 90
          },
          "note": "ms between panels (default 60)"
        },
        {
          "name": "shake",
          "in": "demo",
          "values": {
            "strict": false,
            "refined": false,
            "playful": true
          },
          "note": "the jolt on impact"
        },
        {
          "name": "sound",
          "in": "demo",
          "values": {
            "strict": false,
            "refined": false,
            "playful": true
          }
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.33,
            "p99Ms": 18.205,
            "low1Fps": 50.1
          },
          "notes": "Measured changing screens by itself every 1.6 s, and every third change turned round halfway, so the frames hold the panels travelling, stopping, latching and bolting (and unbolting and leaving), with the latches and bolts drawn and the stage jolting on each stop. At rest the frame loop stops."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.01,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 48 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.02,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 146 ms."
        }
      ],
      "signatures": [
        {
          "file": "choreography.ts",
          "declarations": "import { type Cue, type Phase, type RigOptions } from './rig';\nexport type Rail = 'left' | 'right' | 'top' | 'bottom';\nexport type Move = 'slide' | 'hinge';\nexport type { Cue, Phase } from './rig';\nexport type ChoreographyOptions = {\n    screens: Record<string, HTMLElement>;\n    initial: string;\n    stagger?: number;\n    leaveStagger?: number;\n    handoff?: number;\n    rig?: RigOptions;\n    hingeOvershoot?: number;\n    margin?: number;\n    decor?: boolean;\n    timeScale?: number;\n    reducedMotion?: () => boolean;\n    onCue?: (cue: Cue, panel: HTMLElement, power: number) => void;\n    onChange?: (screen: string, state: 'start' | 'settled') => void;\n};\nexport type Choreography = {\n    readonly current: string;\n    readonly busy: boolean;\n    go(screen: string): Promise<boolean>;\n    phases(screen?: string): Array<{\n        panel: HTMLElement;\n        phase: Phase;\n    }>;\n    timeScale: number;\n    step(dt: number): void;\n    measure(): void;\n    dispose(): void;\n};\nexport declare function choreograph(stage: HTMLElement, options: ChoreographyOptions): Choreography;\nexport declare function jolt(el: HTMLElement, px?: number, reducedMotion?: () => boolean): void;"
        },
        {
          "file": "rig.ts",
          "declarations": "export type Phase = 'gone' | 'arriving' | 'stopping' | 'latching' | 'bolting' | 'locked' | 'unbolting' | 'unlatching' | 'leaving';\nexport type Cue = 'push' | 'stop' | 'latch' | 'bolt' | 'locked' | 'unbolt' | 'unlatch' | 'leave' | 'gone';\nexport type RigTiming = {\n    travel: number;\n    leave: number;\n    stop: number;\n    latch: number;\n    bolts: number;\n    unbolt: number;\n    unlatch: number;\n};\nexport type RigOptions = Partial<RigTiming> & {\n    overshoot?: number;\n    clicks?: number;\n};\nexport declare const DEFAULT_TIMING: RigTiming;\nexport type PanelRig = {\n    pos: number;\n    vel: number;\n    latch: number;\n    bolts: number;\n    want: 'in' | 'out';\n    acting: 'in' | 'out';\n    wait: number;\n    distance: number;\n    stopT: number;\n    power: number;\n    phase: Phase;\n};\nexport declare function rig(distance: number, at?: 'in' | 'out'): PanelRig;\nexport declare function aim(r: PanelRig, want: 'in' | 'out', delay?: number): void;\nexport declare const settled: (r: PanelRig) => boolean;\nexport declare const ratchet: (n: number) => (k: number) => number;\nexport declare function stopOffset(t: number, amp: number): number;\nexport declare function step(r: PanelRig, dt: number, options?: RigOptions, onCue?: (cue: Cue, power: number) => void): void;\nexport declare function pose(r: PanelRig, clicks?: number): {\n    offset: number;\n    latch: number;\n    bolts: number;\n    phase: Phase;\n    shown: boolean;\n};"
        }
      ],
      "pitfalls": [
        "The screens must share one place",
        "Panels are measured with their transforms off when a change starts and when the stage resizes",
        "The module writes each panel’s transform",
        "Hinged panels need backface-visibility",
        "Input never waits: the screen being left is inert at once and the new one is live at once",
        "Announce the change yourself (a polite live region, as the demo does)",
        "Reduced motion swaps the travel for a fade at the seat",
        "stagger, the rig timings and decor are read when the choreography is made"
      ],
      "card": "entries/panel-choreography.json"
    },
    {
      "id": "pdf-field-map",
      "aliases": [],
      "name": "Field map on a fixed-layout page",
      "summary": "Map where each value sits on a PDF or a scan with a text layer, from nothing but its words and their boxes. Draw a box, or click a word and the box snaps to the phrase; click a row and it takes the block of rows, with columns guessed from the gaps and dashed column lines you drag. Each new box is named after the label beside it, and that label can be an anchor: when a later page is printed lower or further right, the box follows it. A live preview reads the whole layout off the page and says whether it would be accepted, and why not. A pure word-geometry core (tested) and a plain-DOM editor over any page picture, with tool keys, nudges, a keyboard caret over the words, mouse and touch.",
      "category": "data",
      "role": "system",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "pdf",
        "fixed layout",
        "word boxes",
        "text layer",
        "ocr",
        "extraction",
        "templates",
        "mapping",
        "bounding boxes",
        "snap",
        "phrase",
        "table columns",
        "column detection",
        "anchors",
        "labels",
        "layout shift",
        "preview",
        "validation",
        "receipts",
        "forms",
        "import",
        "ingest",
        "keyboard",
        "touch",
        "accessibility",
        "pure",
        "tested",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "reading values off receipts, statements and forms that always look the same",
        "letting a person teach a layout by clicking the values on a sample",
        "line-item tables: rows and columns out of loose words",
        "pages that drift a little between printings or senders",
        "checking a layout against another page before it goes live",
        "turning highlights on a sample into fields"
      ],
      "interaction": "B and click a value: the box snaps to the phrase · T and click a row · drag a dashed column line · try the next receipt, then make the total follow its label",
      "kits": [],
      "pairsWith": [
        {
          "id": "field-rules",
          "why": "Decide which mapped values need a person"
        },
        {
          "id": "review-queue",
          "why": "Where those values wait"
        },
        {
          "id": "file-drop",
          "why": "Drop the PDF or scan to map"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": null,
          "cpuMs": 0.395,
          "cpuP95Ms": 0.78,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.528,
            "p99Ms": 29.3,
            "low1Fps": 32.9
          },
          "notes": "Measured with the demo editing itself: every frame it nudges the total’s box half a point (and back), so each frame reads the whole layout off the page again (four fields, a four-column table, the labels looked for) and repaints the boxes, the field list and the verdict; every 45 frames it swaps receipts, so the boxes follow their labels. Nothing runs while nothing changes."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.493,
          "cpuP95Ms": 0.92,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 82 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.38,
          "cpuP95Ms": 1.32,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 134 ms."
        }
      ],
      "signatures": [
        {
          "file": "field-map.ts",
          "declarations": "import { type Rect, type Word } from './word-geometry';\nimport { type Check, type Field, type Layout, type Preview } from './layout';\nexport type Tool = 'select' | 'value' | 'table';\nexport type FieldMapOptions = {\n    page: {\n        width: number;\n        height: number;\n    };\n    words: Word[];\n    layout?: Layout;\n    art?: HTMLElement | null;\n    zoom?: number | 'fit' | 'fit-width';\n    check?: Check;\n    palette?: readonly string[];\n    keyTarget?: HTMLElement | Document;\n    phraseGap?: number;\n    columnGap?: number;\n    label?: string;\n    onChange?(layout: Layout, preview: Preview, how: 'live' | 'done'): void;\n    onSelect?(id: string | null): void;\n    onTool?(tool: Tool): void;\n    announce?(message: string): void;\n};\nexport type FieldMap = {\n    readonly element: HTMLElement;\n    tool(): Tool;\n    setTool(tool: Tool, opts?: {\n        focus?: boolean;\n        quiet?: boolean;\n    }): void;\n    selected(): string | null;\n    select(id: string | null, opts?: {\n        focus?: boolean;\n    }): void;\n    layout(): Layout;\n    setLayout(layout: Layout): void;\n    update(id: string, patch: Partial<Field>): void;\n    follow(id: string, text: string | null): boolean;\n    detectColumns(id: string): void;\n    add(kind: Field['kind'], rect: Rect): Field;\n    remove(id: string): void;\n    tryWords(words: Word[] | null): void;\n    trying(): boolean;\n    preview(): Preview;\n    setZoom(zoom: number | 'fit' | 'fit-width'): void;\n    zoom(): number;\n    showWords(on: boolean): void;\n    setOptions(o: {\n        phraseGap?: number;\n        columnGap?: number;\n    }): void;\n    dispose(): void;\n};\nexport declare function createFieldMap(host: HTMLElement, o: FieldMapOptions): FieldMap;"
        },
        {
          "file": "layout.ts",
          "declarations": "import { type Anchor, type Column, type FieldType, type Rect, type Word } from './word-geometry';\ntype FieldBase = {\n    id: string;\n    name: string;\n    label: string;\n    rect: Rect;\n    mandatory: boolean;\n    anchor?: Anchor | null;\n    hint?: Anchor | null;\n    color?: string;\n};\nexport type ValueField = FieldBase & {\n    kind: 'value';\n    type: FieldType;\n};\nexport type TableField = FieldBase & {\n    kind: 'table';\n    columns: Column[];\n};\nexport type Field = ValueField | TableField;\nexport type Layout = {\n    fields: Field[];\n    recognise?: string[];\n};\nexport type CheckResult = {\n    ok: true;\n    value: unknown;\n} | {\n    ok: false;\n    message: string;\n};\nexport type Check = (text: string, type: FieldType, field: Field) => CheckResult;\nexport declare function parseAmount(text: string): number | null;\nexport declare function parseDate(text: string): string | null;\nexport declare const checkType: Check;\nexport type ReadStatus = 'ok' | 'missing' | 'invalid';\nexport type FieldRead = {\n    id: string;\n    name: string;\n    label: string;\n    kind: Field['kind'];\n    mandatory: boolean;\n    rect: Rect;\n    columns?: Column[];\n    shift: [\n        number,\n        number\n    ];\n    anchor: 'found' | 'lost' | null;\n    text: string;\n    value: unknown;\n    rows?: Array<Record<string, unknown>>;\n    status: ReadStatus;\n    message: string;\n};\nexport type Finding = {\n    id: string | null;\n    label: string;\n    message: string;\n};\nexport type Preview = {\n    accepted: boolean;\n    recognised: boolean | null;\n    fields: Record<string, FieldRead>;\n    problems: Finding[];\n    warnings: Finding[];\n};\nexport type PreviewOptions = {\n    check?: Check;\n    reach?: number;\n    lineTolerance?: number;\n};\nexport declare function readField(words: readonly Word[], f: Field, { check, reach, lineTolerance }?: PreviewOptions): FieldRead;\nexport declare function preview(words: readonly Word[], layout: Layout, options?: PreviewOptions): Preview;\nexport declare function uniqueName(base: string, fields: readonly Field[], exceptId?: string): string;\nexport declare const PALETTE: string[];\nexport declare function makeField(kind: Field['kind'], rect: Rect, words: readonly Word[], layout: Layout, o?: {\n    columnGap?: number;\n    palette?: readonly string[];\n}): Field;\nexport declare function snapAt(kind: Field['kind'], words: readonly Word[], x: number, y: number, o?: {\n    phraseGap?: number;\n    columnGap?: number;\n}): Rect | null;\nexport declare function setAnchor(f: Field, text: string | null, sampleWords: readonly Word[]): boolean;\nexport {};"
        },
        {
          "file": "word-geometry.ts",
          "declarations": "export type Rect = [\n    x0: number,\n    y0: number,\n    x1: number,\n    y1: number\n];\nexport type Word = {\n    text: string;\n    x0: number;\n    y0: number;\n    x1: number;\n    y1: number;\n};\nexport type Phrase = {\n    rect: Rect;\n    words: Word[];\n    text: string;\n};\nexport type Anchor = {\n    text: string;\n    rect: Rect;\n};\nexport type FieldType = 'text' | 'integer' | 'decimal' | 'date';\nexport type Column = {\n    name: string;\n    label?: string;\n    x0: number;\n    x1: number;\n    type: FieldType;\n};\nexport type Handle = 'nw' | 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w';\nexport declare const round1: (v: number) => number;\nexport declare const rectOf: (w: Word) => Rect;\nexport declare function boundsOf(words: readonly Word[], pad?: number): Rect;\nexport declare const rectFromPoints: (ax: number, ay: number, bx: number, by: number) => Rect;\nexport declare const moveRect: (r: Rect, dx: number, dy: number) => Rect;\nexport declare function clampRect(r: Rect, width: number, height: number): Rect;\nexport declare function overlap(a: Rect, b: Rect): number;\nexport declare const inside: (w: Word, r: Rect) => boolean;\nexport declare const wordsIn: (words: readonly Word[], r: Rect) => Word[];\nexport declare function lines(words: readonly Word[], tolerance?: number): Word[][];\nexport declare const textIn: (words: readonly Word[], r: Rect, tolerance?: number) => string;\nexport declare function wordAt(words: readonly Word[], x: number, y: number, slop?: number): Word | null;\nexport type PhraseOptions = {\n    gap?: number;\n    pad?: number;\n    lineTolerance?: number;\n};\nexport declare function phraseAt(words: readonly Word[], x: number, y: number, o?: PhraseOptions): Phrase | null;\nexport declare function phraseAround(words: readonly Word[], w: Word, { gap, pad, lineTolerance }?: PhraseOptions): Phrase;\nexport declare function spans(line: readonly Word[], gap?: number): Word[][];\nexport type BlockOptions = {\n    columnGap?: number;\n    lineTolerance?: number;\n    pad?: number;\n    spacing?: number;\n};\nexport declare function blockAt(words: readonly Word[], x: number, y: number, { columnGap, lineTolerance, pad, spacing }?: BlockOptions): Phrase | null;\nexport declare function looksNumber(text: string): boolean;\nexport declare function guessType(text: string): FieldType;\nexport declare const slug: (s: string) => string;\nexport type ColumnOptions = {\n    columnGap?: number;\n    headerReach?: number;\n    lineTolerance?: number;\n};\nexport declare function guessColumns(words: readonly Word[], r: Rect, { columnGap, headerReach, lineTolerance }?: ColumnOptions): Column[];\nexport declare function readTable(words: readonly Word[], table: {\n    rect: Rect;\n    columns: readonly Column[];\n}, lineTolerance?: number): Array<Record<string, string>>;\nexport type LabelOptions = {\n    lineTolerance?: number;\n    reachLeft?: number;\n    reachAbove?: number;\n    joinGap?: number;\n};\nexport declare function suggestLabel(words: readonly Word[], r: Rect, { lineTolerance, reachLeft, reachAbove, joinGap }?: LabelOptions): Anchor | null;\nexport declare function findPhrase(words: readonly Word[], text: string, lineTolerance?: number): Rect[];\nexport type Follow = {\n    dx: number;\n    dy: number;\n    found: boolean | null;\n};\nexport declare function followAnchor(words: readonly Word[], anchor: Anchor | null | undefined, reach?: number): Follow;\nexport declare function anchorFor(words: readonly Word[], text: string, near: Rect): Anchor | null;\nexport declare function resizeRect(r0: Rect, handle: Handle, dx: number, dy: number, min?: number): Rect;\nexport declare const shiftColumns: (columns: readonly Column[], dx: number) => Column[];\nexport declare function fitColumns(columns: readonly Column[], r: Rect): Column[];\nexport declare function moveColumnLine(columns: readonly Column[], i: number, x: number, min?: number): Column[];\nexport declare function splitWidest(columns: readonly Column[], name: string): Column[];\nexport declare function mergeColumn(columns: readonly Column[], i: number): Column[];\nexport type TextRun = {\n    text: string;\n    x0: number;\n    y0: number;\n    x1: number;\n    y1: number;\n};\nexport declare function wordsFromRuns(runs: readonly TextRun[]): Word[];\nexport declare function runFromTransform(text: string, transform: readonly number[], width: number, toPage: (x: number, y: number) => readonly number[]): TextRun | null;\nexport type Mark = {\n    rect: Rect;\n};\nexport declare function groupMarks(marks: readonly Mark[], words: readonly Word[], pageHeight: number, reachBelow?: number): {\n    tables: Array<{\n        rect: Rect;\n        rows: number[];\n    }>;\n    singles: Rect[];\n};\nexport declare const readingOrder: (words: readonly Word[], tolerance?: number) => Word[];\nexport declare function stepWord(words: readonly Word[], from: Word | null, key: 'ArrowLeft' | 'ArrowRight' | 'ArrowUp' | 'ArrowDown' | 'Home' | 'End', tolerance?: number): Word | null;"
        }
      ],
      "pitfalls": [
        "Boxes are in page units (PDF points), origin top left, y down, on the page as it is shown",
        "pdf.js gives text runs, not words. wordsFromRuns cuts them by character count",
        "A word belongs to a box when its centre is inside it",
        "A box with no anchor stays where it was drawn",
        "An anchor is found by its whole words, ignoring case (its last word may carry a colon)",
        "Columns follow the anchor sideways only",
        "Column types are guessed from the sample’s cells",
        "Tool keys (V, B, T, Esc) are heard on keyTarget, so set it to the editor’s whole screen",
        "The layout keeps the sample’s positions",
        "Import field-map.base.css, then field-map.css (or your own look)"
      ],
      "card": "entries/pdf-field-map.json"
    },
    {
      "id": "perf-gates",
      "aliases": [],
      "name": "Performance and visual gates for any app",
      "summary": "A gate an app copies, with no packages: one Node script opens the app in headless Chrome on a fresh profile at an exact viewport and fails the run when a budget breaks. The first time each effect plays, its longest frame and any pipeline built while drawing; an idle test that fails on any frame drawn (or GPU submit) while nothing moves; each scenario played the same way with the real mouse, judged on its frame p95, the p95 of the app’s own work and its hitches; and screenshots compared pixel by pixel with their baselines, with a picture of where they differ. A fixed CPU loop before and after says whether the machine stayed the same, and each run is compared with the last. The app says what to play through a small in-page probe.",
      "category": "systems",
      "role": "tooling",
      "stack": [
        "headless"
      ],
      "character": "calm",
      "tags": [
        "performance",
        "perf gate",
        "hitch",
        "first use",
        "idle",
        "render on demand",
        "p95",
        "frame budget",
        "visual regression",
        "screenshots",
        "baseline",
        "png",
        "headless chrome",
        "devtools protocol",
        "ci",
        "node",
        "no dependencies"
      ],
      "useCases": [
        "catching a first-use hitch before people do",
        "proving an app draws nothing while nothing moves",
        "a frame budget per scenario, checked on every change",
        "screenshots that fail the build when a style change moves something",
        "comparing a run with the last one, on the same machine",
        "perf checks in CI without a test framework"
      ],
      "interaction": "Run the gate: four bugs fail it · switch each bug off, run again until it passes · pick a row for its frames, or the shots for where they differ",
      "kits": [],
      "pairsWith": [
        {
          "id": "dynamic-resolution",
          "why": "Gate the budget it holds"
        },
        {
          "id": "reach-test",
          "why": "Gate reachability in the same run"
        },
        {
          "id": "zfight-check",
          "why": "Gate flicker in the same run"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": null,
          "cpuMs": 0.035,
          "cpuP95Ms": 0.09,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.96,
            "p99Ms": 29.785,
            "low1Fps": 32.8
          },
          "notes": "Measured exercising itself with every bug fixed: each frame moves the hover across the chart (the handler and one on-demand draw). Idle, the chart draws nothing; a gate run is not part of the bench."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.06,
          "cpuP95Ms": 0.105,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 201 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.02,
          "cpuP95Ms": 0.02,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 293 ms."
        }
      ],
      "signatures": [
        {
          "file": "probe.ts",
          "declarations": "import { type Budget, type FrameStats, type WorkStats } from './gate-core';\nexport type Pointer = {\n    x: number;\n    y: number;\n    down?: boolean;\n};\nexport type Scenario = {\n    pointer?: () => Pointer[];\n    step?: (i: number) => unknown;\n    frames?: number;\n};\nexport type GateSpec = {\n    ready?: () => boolean | Promise<unknown>;\n    firstUse?: Record<string, () => unknown>;\n    scenarios?: Record<string, Scenario>;\n    shots?: Record<string, () => unknown>;\n    draws?: Array<[\n        object,\n        string\n    ]>;\n    work?: Array<[\n        object,\n        string\n    ]>;\n    raf?: boolean;\n    gpu?: boolean;\n    budgets?: {\n        firstUse?: Budget;\n        idle?: Budget;\n        scenario?: Budget;\n        scenarios?: Record<string, Budget>;\n        shot?: Budget;\n    };\n};\nexport type Rect = {\n    x: number;\n    y: number;\n    width: number;\n    height: number;\n};\nexport type FirstUseResult = {\n    label: string;\n    times: number[];\n    stats: FrameStats;\n    pipelines: string[];\n};\nexport type IdleResult = {\n    frames: number;\n    submits: number;\n    rafs: number;\n    ms: number;\n};\nexport type ScenarioResult = {\n    label: string;\n    times: number[];\n    stats: FrameStats;\n    work: Record<string, WorkStats> | null;\n};\nexport type Plan = {\n    firstUse: string[];\n    scenarios: Array<{\n        id: string;\n        pointer: boolean;\n        frames: number;\n    }>;\n    shots: string[];\n    budgets: GateSpec['budgets'];\n};\nexport type Probe = {\n    plan(): Plan;\n    ready(): Promise<boolean>;\n    firstUse(id: string, ms?: number): Promise<FirstUseResult>;\n    idle(o?: {\n        settle?: number;\n        window?: number;\n    }): Promise<IdleResult>;\n    begin(id: string): void;\n    end(id: string): ScenarioResult;\n    path(id: string): Pointer[];\n    run(id: string): Promise<ScenarioResult>;\n    pose(id: string): Promise<Rect | null>;\n    dispose(): void;\n};\nexport declare function recordFrames(): {\n    stop(): number[];\n};\nexport declare function instrument(obj: object, name: string, onCall: (ms: number) => void): () => void;\nexport declare function createProbe(spec: GateSpec): Probe;\ndeclare global {\n    interface Window {\n        __perfGate?: Probe;\n    }\n}\nexport declare function exposeGate(spec: GateSpec): () => void;"
        }
      ],
      "pitfalls": [
        "Measure the worst frames, not the average",
        "Run with the frame rate uncapped (gate.mjs’s flags turn vsync and the frame limit off)",
        "Give a fresh profile to every run",
        "Count your own draws for the idle test (draws: [[app, 'draw']]), not every animation frame",
        "Set the viewport over DevTools and check each screenshot’s size",
        "Take shots in a fixed state",
        "A slower CPU loop after the run than before means the machine got hot or changed power plan",
        "When a run misses its budget, fix it or argue about it",
        "Ship the probe only in builds the gate opens (a query string or a test build)",
        "gate.mjs loads gate-core.ts and png.ts directly, which needs Node 22.18 or later"
      ],
      "card": "entries/perf-gates.json"
    },
    {
      "id": "phone-app-shell",
      "aliases": [],
      "name": "Installable phone app shell",
      "summary": "What turns a web app into something on the home screen: a service worker whose routes are a pure, tested policy (pages network first and kept for offline, hashed built files cache first, /api, ranges and other sites never cached), a cache named by the build with the old one deleted on activate, a Vite plugin that writes the version and file list into sw.js, the manifest and head tags from your app’s name, icon PNGs drawn with no dependencies (Node and canvas), an install tip (Share steps on an iPhone, an Install button where the browser offers), a screen sized to what the keyboard leaves, theme-color repainted with the theme, and a wake lock.",
      "category": "systems",
      "role": "system",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "PWA",
        "progressive web app",
        "service worker",
        "offline",
        "cache",
        "network first",
        "cache first",
        "manifest",
        "install",
        "add to home screen",
        "beforeinstallprompt",
        "iOS",
        "Android",
        "icons",
        "PNG",
        "maskable",
        "visualViewport",
        "keyboard",
        "safe area",
        "theme-color",
        "status bar",
        "wake lock",
        "Vite plugin",
        "touch",
        "phone",
        "accessibility",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "a web app that opens with no signal",
        "installing a web app on iPhone and Android",
        "a bottom bar that stays above the iOS keyboard",
        "app icons and a manifest without a design tool",
        "cache rules for a service worker",
        "keeping the screen on while a list is in a hand"
      ],
      "interaction": "Send requests online and off, deploy a new build · type in the phone to raise its keyboard · install it from the tip or the Share menu",
      "kits": [
        {
          "kit": "foundations",
          "as": "optional"
        },
        {
          "kit": "shop",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "offline-sync",
          "why": "Data that syncs when the app is back online"
        },
        {
          "id": "loading-states",
          "why": "Offline and slow states in the app"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the demo exercising itself: every request sent through the rehearsed worker about twice a second (a new build deployed every fourth round), and the phone’s keyboard opening and closing once a second with the app resized to it. No service worker is registered. At rest nothing runs."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 270 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 359 ms."
        }
      ],
      "signatures": [
        {
          "file": "device.ts",
          "declarations": "import { type DeviceInfo } from './device-logic';\nexport declare function readDevice(win?: Window): DeviceInfo;\nexport declare function markStandalone(device: DeviceInfo, root?: HTMLElement): void;\nexport type KeyboardState = {\n    height: number;\n    inset: number;\n    open: boolean;\n};\nexport type FitOptions = {\n    viewport?: VisualViewport | null;\n    target?: HTMLElement;\n    win?: Window;\n    heightProperty?: string;\n    insetProperty?: string;\n    onChange?(state: KeyboardState): void;\n};\nexport declare function fitToKeyboard(o?: FitOptions): {\n    state(): KeyboardState;\n    dispose(): void;\n};\nexport type ThemeColorOptions = {\n    doc?: Document;\n    read?(): string;\n    watch?: boolean;\n    root?: HTMLElement;\n};\nexport declare function syncThemeColor(o?: ThemeColorOptions): {\n    update(color?: string): string;\n    dispose(): void;\n};\nexport declare function chooseStatusBar(t: 'light' | 'dark', doc?: Document): void;\nexport type WakeState = {\n    supported: boolean;\n    wanted: boolean;\n    active: boolean;\n    error: string | null;\n};\nexport declare function createWakeLock(o?: {\n    nav?: Navigator;\n    doc?: Document;\n    onChange?(s: WakeState): void;\n}): {\n    state: () => WakeState;\n    want(on: boolean): Promise<void>;\n    dispose(): void;\n};"
        },
        {
          "file": "install-tip.ts",
          "declarations": "import { type DeviceInfo, type TipKind } from './device-logic';\nexport type InstallPrompt = {\n    ready(): boolean;\n    prompt(): Promise<'accepted' | 'dismissed' | 'unavailable'>;\n    subscribe(fn: () => void): () => void;\n};\nexport declare function captureInstallPrompt(win?: Window): InstallPrompt & {\n    installed(): boolean;\n    dispose(): void;\n};\nexport type TipLabels = {\n    region: string;\n    iosTitle: string;\n    iosBody: string;\n    androidTitle: string;\n    androidBody: string;\n    install: string;\n    hide: string;\n};\nexport declare const TIP_LABELS: TipLabels;\nexport type StorageLike = Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>;\nexport type InstallTipOptions = {\n    device: DeviceInfo;\n    appName: string;\n    icon?: string | HTMLElement;\n    prompt?: InstallPrompt;\n    storage?: StorageLike | null;\n    key?: string;\n    force?: 'ios' | 'android';\n    labels?: Partial<TipLabels>;\n    focusAfter?(): HTMLElement | null;\n    onChange?(kind: TipKind, why: 'shown' | 'hidden' | 'installed' | 'dismissed'): void;\n};\nexport declare function mountInstallTip(host: HTMLElement, o: InstallTipOptions): {\n    readonly element: HTMLElement | null;\n    kind: () => TipKind;\n    reset(): void;\n    dispose(): void;\n};"
        },
        {
          "file": "register.ts",
          "declarations": "export type RegisterOptions = {\n    url?: string;\n    enabled: boolean;\n    onUpdate?(): void;\n    nav?: Navigator;\n    win?: Window;\n};\nexport declare function registerServiceWorker(o: RegisterOptions): Promise<ServiceWorkerRegistration | null>;"
        },
        {
          "file": "service-worker.ts",
          "declarations": "import { type PolicyOptions } from './sw-policy';\nexport type WorkerScopeLike = {\n    addEventListener(type: string, listener: (event: never) => void): void;\n    removeEventListener(type: string, listener: (event: never) => void): void;\n    caches: CacheStorage;\n    fetch(request: Request): Promise<Response>;\n    skipWaiting(): Promise<void>;\n    clients: {\n        claim(): Promise<void>;\n    };\n    registration: {\n        scope: string;\n    };\n};\nexport type ServiceWorkerOptions = Omit<PolicyOptions, 'scope'> & {\n    version: string;\n    prefix?: string;\n    precache?: readonly string[];\n    takeOver?: boolean;\n    onAnswer?(answer: Answer): void;\n};\nexport type Answer = {\n    url: string;\n    strategy: string;\n    rule: string;\n    from: 'network' | 'cache' | 'none';\n    stored: boolean;\n    status: number;\n};\nexport type RunningWorker = {\n    cache: string;\n    dispose(): void;\n};\nexport declare function startServiceWorker(scope: WorkerScopeLike, o: ServiceWorkerOptions): RunningWorker;"
        },
        {
          "file": "vite-plugin.ts",
          "declarations": "type OutChunk = {\n    type: 'chunk';\n    fileName: string;\n    code: string;\n    imports: string[];\n    dynamicImports: string[];\n};\ntype OutAsset = {\n    type: 'asset';\n    fileName: string;\n    source: string | Uint8Array;\n};\nexport type BundleLike = Record<string, OutChunk | OutAsset>;\nexport type PluginContextLike = {\n    emitFile(file: {\n        type: 'chunk';\n        id: string;\n        fileName: string;\n    }): string;\n    error(message: string): never;\n};\nexport type ServiceWorkerPluginOptions = {\n    entry: string;\n    fileName?: string;\n    precache?: (file: string) => boolean;\n    extra?: string[];\n};\nexport declare function serviceWorker(o: ServiceWorkerPluginOptions): {\n    name: string;\n    apply: \"build\";\n    enforce: \"post\";\n    buildStart(this: PluginContextLike): void;\n    generateBundle(this: PluginContextLike, _options: unknown, bundle: BundleLike): void;\n};\nexport {};"
        }
      ],
      "pitfalls": [
        "Never register the worker in development (pass enabled: import.meta.env.PROD)",
        "A service worker controls only URLs under its own folder",
        "The worker must be a classic script, so its entry must not share modules with the app",
        "Serve sw.js with Cache-Control",
        "precache is all or nothing",
        "A file without a hash in its name",
        "iOS reads apple-mobile-web-app-status-bar-style once, at launch",
        "An iPhone never fires beforeinstallprompt, and Safari has no install button",
        "fitToKeyboard needs the viewport meta with interactive-widget=resizes-content for Android",
        "A wake lock is dropped whenever the tab is hidden and is asked for again when it returns",
        "make-icons.mjs loads the .ts files directly, which needs Node 22.18 or later (type stripping)",
        "Hide the tip only when the person asks"
      ],
      "card": "entries/phone-app-shell.json"
    },
    {
      "id": "phosphor-beam",
      "aliases": [],
      "name": "Phosphor beam: scores as a particle beam",
      "summary": "A classifier's scores drawn as a particle beam. Each signal is a deflecting field down a column; every sample flies a closed-form path through them, so how far the beam has spread at any depth is the score so far. It lands on a phosphor plate whose decaying glow is a running histogram, over the exact one on a log scale. Two knife-edge gates stand on the plate and spark where samples graze them; cups below catch what each decision holds; and the ROC beside it lights up bin by bin as the beam lands there. Raw WebGPU compute and a small bloom, with an SVG still and every figure in the page without it.",
      "category": "data",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "roc",
        "histogram",
        "classifier",
        "threshold",
        "scoring",
        "decision gates",
        "particles",
        "beam",
        "phosphor",
        "bloom",
        "raw webgpu",
        "wgsl",
        "compute",
        "atomics",
        "closed-form path",
        "svg fallback",
        "rests when still",
        "timestamp queries",
        "reduced motion",
        "no dependencies"
      ],
      "useCases": [
        "show where a model's thresholds fall, and what moving them costs",
        "a score distribution that fills as the data arrives",
        "the ROC and the histogram as one picture, lit by the same data",
        "how much each signal contributes to a score",
        "spam, fraud, quality checks, alerts: any two-class decision with a review band",
        "a showpiece for a model review or a dashboard"
      ],
      "interaction": "Drag the gates on the plate · the sliders set each field's strength · point at the plate for counts · click the ROC to stand the block gate there · Fire a burst",
      "kits": [],
      "pairsWith": [
        {
          "id": "chart-access",
          "why": "The scores as a table"
        },
        {
          "id": "gpu-crossfilter",
          "why": "Every sample as a mark to brush"
        },
        {
          "id": "quiet-charts",
          "why": "Precision and recall as plain charts"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [
        {
          "name": "calm",
          "in": "module",
          "values": {
            "strict": true
          },
          "note": "a steady plate instead of the moving beam"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 1.837,
          "cpuMs": 0.23,
          "cpuP95Ms": 1.73,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.773,
            "p99Ms": 18.02,
            "low1Fps": 55.1
          },
          "notes": "The day plays at 20 minutes a second with the beam at 1,200 particles a second at the busiest hour (32,768 particles, 16,384 sparks, five fields, bloom at a quarter size), a burst fired every 4 s and the quarantine gate swept back and forth, so the gates spark and the histograms ease; the ROC canvas is drawn in the same frame. Timed with its own timestamp queries. At rest (paused, or reduced motion) a frame costs nothing."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.769,
          "cpuMs": 0.445,
          "cpuP95Ms": 2.455,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 347 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 0.526,
          "cpuMs": 0.48,
          "cpuP95Ms": 4.48,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 648 ms."
        }
      ],
      "signatures": [
        {
          "file": "beam-model.ts",
          "declarations": "export declare const MAX_SIGNALS = 6;\nexport declare const SIG_STRIDE = 6;\nexport type SampleSet = {\n    n: number;\n    nSignals: number;\n    signals: Float32Array;\n    kind: Uint8Array;\n    t: Float32Array;\n    w: Float32Array;\n};\nexport type SampleInput = {\n    signals: ArrayLike<number>;\n    kind: number;\n    t: number;\n    w?: number;\n};\nexport declare function createSampleSet(nSignals: number, capacity?: number): SampleSet;\nexport declare function appendSamples(set: SampleSet, items: readonly SampleInput[]): number;\nexport declare const clamp01: (x: number) => number;\nexport declare function pcg(v: number): number;\nexport declare const rand01: (seed: number, i: number) => number;\nexport declare function stream(seed: number): () => number;\nexport declare function scoreOf(set: SampleSet, i: number, weights: readonly number[], zmax: number, upto?: number): number;\nexport declare function scoreAll(set: SampleSet, weights: readonly number[], zmax: number, upto?: number, out?: Float32Array<ArrayBuffer>): Float32Array;\nexport declare const smoothstep: (a: number, b: number, x: number) => number;\nexport declare function bendAt(signals: ArrayLike<number>, weights: readonly number[], fields: ReadonlyArray<readonly [\n    number,\n    number\n]>, zmax: number, y: number): number;\nexport declare const signalsOf: (set: SampleSet, i: number) => number[];\nexport declare const binOf: (x: number, nb: number) => number;\nexport type Histogram = {\n    nb: number;\n    neg: Float64Array;\n    pos: Float64Array;\n    byKind: Float64Array[];\n};\nexport declare function histogram(set: SampleSet, scores: ArrayLike<number>, nb: number, nKinds: number, tNow?: number, tFrom?: number): Histogram;\nexport type Roc = {\n    pts: Float64Array;\n    auc: number;\n};\nexport declare function roc(h: Histogram): Roc;\nexport declare function tprAt(R: Roc, fpr: number): number;\nexport declare const rocX: (fpr: number, fprMin?: number) => number;\nexport type Decisions = {\n    neg: [\n        number,\n        number,\n        number\n    ];\n    pos: [\n        number,\n        number,\n        number\n    ];\n    negTotal: number;\n    posTotal: number;\n    caught: number;\n    stopped: number;\n    falseAlarm: number;\n};\nexport declare function decide(h: Histogram, gates: readonly [\n    number,\n    number\n]): Decisions;\nexport declare function pushes(set: SampleSet, weights: readonly number[], zmax: number, tNow?: number): Array<{\n    neg: number;\n    pos: number;\n}>;\nexport declare const logH: (n: number, decades?: number) => number;\nexport declare function logTicks(decades?: number): Array<{\n    y: number;\n    label: string;\n}>;\nexport declare const packedLength: (nb: number) => number;\nexport declare function packHist(h: Histogram, R: Roc, { decades, fprMin, smooth, out }?: {\n    decades?: number;\n    fprMin?: number;\n    smooth?: boolean;\n    out?: Float32Array;\n}): Float32Array;\nexport type Spawner = {\n    take(pools: ReadonlyArray<ArrayLike<number>>, perSecond: readonly number[], dt: number, max: number, out: number[]): number;\n    reset(): void;\n};\nexport declare function createSpawner(seed?: number): Spawner;\nexport declare function oneIn(x: number): string;\nexport declare function big(n: number): string;"
        },
        {
          "file": "beam-wgsl.ts",
          "declarations": "export declare const NB = 200;\nexport declare const NBX = 160;\nexport declare const NF = 6;\nexport declare const NE = 16384;\nexport declare const U_FLOATS = 96;\nexport declare const RU_FLOATS = 32;\nexport declare const PH: {\n    readonly specA: 0;\n    readonly specF: 200;\n    readonly workA: number;\n    readonly workF: number;\n    readonly gate: number;\n};\nexport declare const NPH: number;\nexport declare const HI: {\n    readonly A: 0;\n    readonly F: 200;\n    readonly roc: number;\n};\nexport declare const NHIST: number;\nexport declare const HDR_FORMAT: GPUTextureFormat;\nexport declare const SIM_WGSL: string;\nexport declare const DRAW_WGSL: string;\nexport declare const ROC_WGSL: string;\nexport declare const POST_WGSL = \"\\nstruct PU {\\n  texel: vec4f,  // 1 / source size (x, y), blur direction (x, y)\\n  p: vec4f,      // threshold, bloom strength, exposure, ink\\n  q: vec4f,      // vignette, grain, seed, -\\n};\\n@group(0) @binding(0) var<uniform> pu: PU;\\n@group(0) @binding(1) var src: texture_2d<f32>;\\n@group(0) @binding(2) var samp: sampler;\\n@group(0) @binding(3) var bloom: texture_2d<f32>;\\n\\nstruct VO { @builtin(position) p: vec4f, @location(0) uv: vec2f };\\n@vertex fn vs(@builtin(vertex_index) i: u32) -> VO {\\n  let p = array(vec2f(-1.0, -1.0), vec2f(3.0, -1.0), vec2f(-1.0, 3.0))[i];\\n  var o: VO; o.p = vec4f(p, 0.0, 1.0); o.uv = vec2f(p.x * 0.5 + 0.5, 0.5 - p.y * 0.5);\\n  return o;\\n}\\n/** A quarter-size copy (four bilinear taps cover four by four pixels), only what is brighter than the threshold. */\\n@fragment fn prefilter(i: VO) -> @location(0) vec4f {\\n  let t = pu.texel.xy;\\n  var c = textureSample(src, samp, i.uv + vec2f(-t.x, -t.y)).rgb + textureSample(src, samp, i.uv + vec2f(t.x, -t.y)).rgb\\n        + textureSample(src, samp, i.uv + vec2f(-t.x, t.y)).rgb + textureSample(src, samp, i.uv + vec2f(t.x, t.y)).rgb;\\n  c *= 0.25;\\n  let l = max(c.r, max(c.g, c.b));\\n  let knee = 0.25;\\n  let s = clamp(l - pu.p.x + knee, 0.0, 2.0 * knee);\\n  let w = max(s * s / (4.0 * knee), l - pu.p.x) / max(l, 1e-4);\\n  return vec4f(c * max(w, 0.0), 1.0);\\n}\\n/** Nine taps along one direction, binomial weights. */\\n@fragment fn blur(i: VO) -> @location(0) vec4f {\\n  let d = pu.texel.xy * pu.texel.zw;\\n  var wts = array(70.0, 56.0, 28.0, 8.0, 1.0);\\n  var c = textureSample(src, samp, i.uv).rgb * wts[0];\\n  for (var k = 1; k < 5; k++) {\\n    c += (textureSample(src, samp, i.uv + d * f32(k)).rgb + textureSample(src, samp, i.uv - d * f32(k)).rgb) * wts[k];\\n  }\\n  return vec4f(c / 256.0, 1.0);\\n}\\nfn pcg(v: u32) -> u32 { let s = v * 747796405u + 2891336453u; let w = ((s >> ((s >> 28u) + 4u)) ^ s) * 277803737u; return (w >> 22u) ^ w; }\\nfn shoulder(x: f32) -> f32 { return select(x, 0.62 + 0.38 * (1.0 - exp(-(x - 0.62) / 0.38)), x > 0.62); }\\n@fragment fn finish(i: VO) -> @location(0) vec4f {\\n  let base = textureSample(src, samp, i.uv).rgb;\\n  let b = textureSample(bloom, samp, i.uv).rgb;\\n  let ink = pu.p.w;\\n  var c = base + b * pu.p.y * (1.0 - ink);\\n  let e = c * pu.p.z;\\n  let toned = vec3f(shoulder(e.r), shoulder(e.g), shoulder(e.b));\\n  c = mix(toned, clamp(c, vec3f(0.0), vec3f(1.0)), ink);\\n  let v = i.uv - 0.5;\\n  c *= 1.0 - pu.q.x * dot(v, v) * 1.6;\\n  let px = vec2u(i.p.xy);\\n  let n = f32(pcg(px.x * 1973u + px.y * 9277u + u32(pu.q.z) * 26699u) >> 8u) / 16777216.0 - 0.5;\\n  c += vec3f(n * pu.q.y);\\n  return vec4f(clamp(c, vec3f(0.0), vec3f(1.0)), 1.0);\\n}\\n\";"
        },
        {
          "file": "drag-handle.ts",
          "declarations": "export type DragHandleOptions = {\n    get(): number;\n    set(v: number): void;\n    toValue(e: PointerEvent): number;\n    min?: number;\n    max?: number;\n    step?: number;\n    big?: number;\n    text?(v: number): string;\n    done?(): void;\n};\nexport type DragHandle = {\n    update(): void;\n    dispose(): void;\n};\nexport declare function dragHandle(el: HTMLElement, o: DragHandleOptions): DragHandle;"
        },
        {
          "file": "phosphor-beam.ts",
          "declarations": "import { type SampleSet } from './beam-model';\ntype RGB = readonly [\n    number,\n    number,\n    number\n];\nexport type BeamGeometry = {\n    x0: number;\n    x1: number;\n    ySrc: number;\n    fields: ReadonlyArray<readonly [\n        number,\n        number\n    ]>;\n    gTop: number;\n    yPlate: number;\n    specH: number;\n    cup?: number;\n    frame?: {\n        x0: number;\n        y0: number;\n        x1: number;\n        y1: number;\n    };\n};\nexport type BeamPalette = {\n    beam: RGB;\n    negative: RGB;\n    positive: RGB;\n    gate1: RGB;\n    gate2: RGB;\n};\nexport type BeamLook = {\n    ink: boolean;\n    background: RGB;\n    glow?: Partial<BeamPalette>;\n    inks?: Partial<BeamPalette>;\n};\nexport type PhosphorBeamOptions = {\n    samples: SampleSet;\n    zmax: number;\n    weights?: readonly number[];\n    gates?: readonly [\n        number,\n        number\n    ];\n    look?: BeamLook;\n    particles?: number;\n    calm?: boolean;\n    truthInFlight?: boolean;\n    truthDelay?: number;\n    life?: number;\n    fallSpeed?: number;\n    maxDpr?: number;\n    bloom?: number;\n    device?: GPUDevice;\n    onError?: (message: string) => void;\n};\nexport type RocView = {\n    layout(rect: {\n        x: number;\n        y: number;\n        w: number;\n        h: number;\n    }): void;\n    dispose(): void;\n};\nexport type PhosphorBeam = {\n    readonly device: GPUDevice;\n    setGeometry(g: BeamGeometry): void;\n    setWeights(w: readonly number[]): void;\n    setGates(g: readonly [\n        number,\n        number\n    ]): void;\n    setHist(packed: Float32Array, snap?: boolean): void;\n    setSamples(set: SampleSet, from?: number): void;\n    fire(indices: ArrayLike<number>): void;\n    setLook(look: BeamLook): void;\n    setTruth(inFlight: boolean, delay?: number): void;\n    setCalm(calm: boolean): void;\n    setHover(bin: number): void;\n    setSelected(field: number): void;\n    frame(dt: number): boolean;\n    readonly resting: boolean;\n    gpuMs(): number | null;\n    attachRoc(canvas: HTMLCanvasElement): RocView;\n    readonly lost: boolean;\n    onLost: ((reason: string) => void) | null;\n    dispose(): void;\n};\nexport declare function createPhosphorBeam(canvas: HTMLCanvasElement, options: PhosphorBeamOptions): Promise<PhosphorBeam | null>;\nexport {};"
        }
      ],
      "pitfalls": [
        "The beam is a picture of the data, not the data",
        "The path is closed form: x at depth y is the sum of weight × signal × smoothstep over each…",
        "Scores are clamped at the far end of the plate (zmax)",
        "setHist wants exactly packHist's layout (200 bins, log heights, then the ROC on its log x)",
        "The plate's glow is a running histogram with memory (it fades with a 1.8 s time constant)",
        "Truth after landing: by default a positive flies the same colour as everything else and flares…",
        "The canvas takes no pointer",
        "It rests: with nothing fired for the flight time plus a spot's life and a few seconds",
        "Reduced motion: no beam (calm), the fill keeps a steady light, and it draws only on a change",
        "Several canvases share one device",
        "A software adapter (isFallbackAdapter) is refused",
        "A lost device (a driver reset, a sleeping laptop) sets lost and calls onLost"
      ],
      "card": "entries/phosphor-beam.json"
    },
    {
      "id": "phosphor-terminal",
      "aliases": [],
      "name": "Phosphor terminal",
      "summary": "A CRT phosphor terminal drawn round live DOM text: the text stays real, selectable and read aloud, and the tube is laid over it. A WebGPU glass with a bezel, curved corners, scanlines that bow, a slot mask, a slow refresh band, grain and a power-on; halation round each lit line; a glow on the text; and persistence, the old picture fading as the new one is drawn. A CSS glass where WebGPU is missing, a still glass under reduced motion, and a plain mode for more contrast.",
      "category": "post",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "crt",
        "retro",
        "terminal",
        "scanlines",
        "bloom",
        "persistence",
        "afterglow",
        "overlay",
        "webgpu",
        "css fallback",
        "accessibility",
        "reduced motion",
        "no dependencies"
      ],
      "useCases": [
        "consoles and command lines with a look",
        "retro game menus and HUDs",
        "logs and status boards",
        "a theme for a whole app",
        "title screens and loading screens"
      ],
      "interaction": "Type a command (help, list, sky, colour green) · select any text · scroll the log",
      "kits": [],
      "pairsWith": [
        {
          "id": "ui-sounds",
          "why": "Keys and a power-on hum"
        },
        {
          "id": "keyboard-shortcuts",
          "why": "A keyboard-first interface on the tube"
        },
        {
          "id": "command-palette",
          "why": "Commands typed at the prompt"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "motion",
          "in": "module",
          "values": {
            "strict": "reduced",
            "playful": "full"
          },
          "note": "reduced: the glass holds still, no afterglow or power-on"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 0.105,
          "cpuMs": 0.015,
          "cpuP95Ms": 0.495,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.185,
            "p99Ms": 17.825,
            "low1Fps": 55.8
          },
          "notes": "Measured with the demo printing by itself: a 14-line listing streams in (a line every 45 ms, each typed on), scrolls, and leaves an afterglow per line; then it waits and runs again. The GPU glass (one full-screen pass and up to 160 halation quads) draws every frame while the refresh band, flicker and grain move."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.131,
          "cpuMs": 0.02,
          "cpuP95Ms": 0.74,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.635,
            "p99Ms": 18.17,
            "low1Fps": 43.8
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 22 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 3.942,
          "cpuMs": 0.02,
          "cpuP95Ms": 3.16,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 143 ms."
        }
      ],
      "signatures": [
        {
          "file": "phosphor-terminal.ts",
          "declarations": "import { type Palette, type PhosphorName } from './phosphor-model';\nexport type GlassMode = 'auto' | 'css' | 'off';\nexport type PhosphorOptions = {\n    screen: HTMLElement;\n    phosphor?: PhosphorName | Palette;\n    scanlines?: number;\n    mask?: number;\n    curvature?: number;\n    bloom?: number;\n    halation?: number;\n    persistence?: number;\n    decay?: number;\n    grain?: number;\n    band?: boolean;\n    flicker?: boolean;\n    glass?: GlassMode;\n    motion?: 'auto' | 'full' | 'reduced';\n    bezel?: number;\n    glow?: string;\n    onGlass?: (glass: 'gpu' | 'css' | 'off', why?: 'lost') => void;\n};\nexport type PhosphorTerminal = {\n    readonly glass: 'gpu' | 'css' | 'off';\n    readonly ready: Promise<void>;\n    set(options: Partial<Omit<PhosphorOptions, 'screen'>>): void;\n    powerOn(ms?: number): void;\n    burn(): void;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare function phosphorTerminal(host: HTMLElement, options: PhosphorOptions): PhosphorTerminal;"
        }
      ],
      "pitfalls": [
        "The text is never warped",
        "Pad the host by at least the bezel (14 px by default) and a little more",
        "Persistence copies the screen’s rows on show each time it changes, at most once a frame",
        "The screen’s background must be transparent, or it hides the afterglow under it",
        "A large text-shadow on a lot of text is a paint cost on every scroll",
        "The GPU glass draws every frame only while something on it moves",
        "Under prefers-contrast: more or forced colours the glass, glow and afterglow are all dropped",
        "WebGPU arrives a moment after the page",
        "A WebGPU device can be lost (a driver reset, a sleeping laptop)",
        "Afterglow copies are inert and lose their ids, tab stops, names and autoplay"
      ],
      "card": "entries/phosphor-terminal.json"
    },
    {
      "id": "physical-sky",
      "aliases": [],
      "name": "Physical sky",
      "summary": "A sky worked out from the air itself on WebGPU (the same passes on WebGL2 where it is missing): Rayleigh and Mie scattering and ozone, marched into transmittance, multiple-scattering and sky-view tables (Hillaire 2020), drawn for any camera with the sun’s disc, stars, the ground and low hills, auto exposure and ACES. Moving the sun rebuilds one small table; the light it gives a scene comes back for your own lights.",
      "category": "technique",
      "role": "hero-visual",
      "stack": [
        "webgpu"
      ],
      "character": "balanced",
      "tags": [
        "sky",
        "atmosphere",
        "scattering",
        "time of day",
        "raw webgpu",
        "wgsl",
        "glsl",
        "webgl2 fallback",
        "tone mapping",
        "lighting"
      ],
      "useCases": [
        "outdoor scenes and games",
        "time-of-day and weather systems",
        "architectural and product renders",
        "backdrops for hero sections",
        "lighting a scene from its sky",
        "flight and space views"
      ],
      "interaction": "Drag to look around · wheel or + − to zoom · Play a day",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "cinematic-lens",
          "why": "Bloom and light shafts from its sun"
        },
        {
          "id": "lit-height-fog",
          "why": "Fog lit by the same sun"
        },
        {
          "id": "aurora",
          "why": "The night sky’s aurora"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 3.366,
          "cpuMs": 0.36,
          "cpuP95Ms": 0.505,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Plays the day on a loop (the view following the sun), so every frame rebuilds the sky-view table and the probe and draws the sky at the stage’s size; timed with its own timestamp queries. At rest it draws nothing."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.507,
          "cpuMs": 0.602,
          "cpuP95Ms": 0.865,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 307 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 9.568,
          "cpuMs": 0.6,
          "cpuP95Ms": 0.8,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 62 ms."
        }
      ],
      "signatures": [
        {
          "file": "physical-sky-gl.ts",
          "declarations": "import { type Atmosphere, type SkyCamera, type SkyLight, type SkyOptions, type SkyTable } from './physical-sky';\nexport type SkyTargetGL = null | {\n    framebuffer: WebGLFramebuffer;\n    width: number;\n    height: number;\n};\nexport type PhysicalSkyGL = {\n    readonly api: 'webgl2';\n    setSun(azimuth: number, elevation: number): void;\n    setAtmosphere(changes: Partial<Atmosphere>): void;\n    readonly atmosphere: Readonly<Atmosphere>;\n    hills: number;\n    stars: number;\n    update(): SkyTable[];\n    draw(target: SkyTargetGL, camera: SkyCamera): boolean;\n    readonly busy: boolean;\n    readonly rebuilt: SkyTable[];\n    readonly light: SkyLight | null;\n    onLight: ((light: SkyLight) => void) | null;\n    readonly textures: Record<SkyTable, WebGLTexture>;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport type SkyOptionsGL = Omit<SkyOptions, 'format'>;\nexport declare function createPhysicalSkyGL(gl: WebGL2RenderingContext, options?: SkyOptionsGL): Promise<PhysicalSkyGL | null>;"
        },
        {
          "file": "physical-sky.ts",
          "declarations": "export type Vec3 = [\n    number,\n    number,\n    number\n];\nexport type Atmosphere = {\n    haze: number;\n    ozone: number;\n    rayleigh: number;\n    mieG: number;\n    albedo: number;\n    height: number;\n};\nexport declare const EARTH: Atmosphere;\nexport type SkyCamera = {\n    yaw: number;\n    pitch: number;\n    fov: number;\n    exposure?: number;\n    autoExposure?: boolean;\n};\nexport type SkyLight = {\n    sunDirection: Vec3;\n    sun: Vec3;\n    sky: Vec3;\n    horizonSun: Vec3;\n    horizonAway: Vec3;\n};\nexport type SkyTable = 'transmittance' | 'multiScattering' | 'skyView';\nexport type PhysicalSky = {\n    setSun(azimuth: number, elevation: number): void;\n    setAtmosphere(changes: Partial<Atmosphere>): void;\n    readonly atmosphere: Readonly<Atmosphere>;\n    hills: number;\n    stars: number;\n    update(): SkyTable[];\n    draw(target: GPUCanvasContext | GPUTexture, camera: SkyCamera): boolean;\n    readonly busy: boolean;\n    readonly rebuilt: SkyTable[];\n    readonly light: SkyLight | null;\n    onLight: ((light: SkyLight) => void) | null;\n    readonly textures: Record<SkyTable, GPUTexture>;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport type SkyOptions = {\n    format?: GPUTextureFormat;\n    toneMap?: boolean;\n    sunRadius?: number;\n    atmosphere?: Partial<Atmosphere>;\n};\nexport declare const fromAngles: (az: number, el: number) => Vec3;\nexport declare function sunAt(hours: number, latitude?: number, declination?: number): {\n    azimuth: number;\n    elevation: number;\n};\nexport declare function createPhysicalSky(device: GPUDevice, options?: SkyOptions): Promise<PhysicalSky>;"
        }
      ],
      "pitfalls": [
        "Units are kilometres inside and the sun’s light above the air is 1",
        "The tables are half floats stored × 1024",
        "Tone mapping writes display-ready values for an 8-bit, non-sRGB target",
        "draw() returns false while the last frame is still on the GPU and does not touch the canvas then",
        "The light comes back a frame or two after the sun moves (a GPU read-back)",
        "The ground is a sphere at the eye’s height minus its height",
        "Without WebGPU, createPhysicalSkyGL draws the same sky on WebGL2 from sky-glsl.ts",
        "Auto exposure holds a floor at night so night stays dark"
      ],
      "card": "entries/physical-sky.json"
    },
    {
      "id": "pixel-art-layer",
      "aliases": [],
      "name": "Pixel-art layer",
      "summary": "Draw with ordinary Canvas 2D calls (circles, gradients, paths) at a low resolution, and get true pixel art: every art pixel a whole number of device pixels, scaled nearest-neighbour, soft edges turned into ordered dither, colours snapped to a palette through a lookup table, and a one-pixel outline in a dark shade of what it rings. Planes back to front (the still ones reused), a 5×7 block font, drawn only when asked.",
      "category": "canvas",
      "role": "system",
      "stack": [
        "canvas2d",
        "dom"
      ],
      "character": "calm",
      "tags": [
        "pixel art",
        "canvas 2d",
        "nearest neighbour",
        "image-rendering pixelated",
        "ordered dither",
        "bayer",
        "palette",
        "quantize",
        "outline",
        "bitmap font",
        "retro",
        "device pixel ratio",
        "no dependencies"
      ],
      "useCases": [
        "retro and playful themes",
        "game menus and HUDs in pixel art",
        "pixel-art backgrounds behind a DOM interface",
        "turning vector drawings into pixel art",
        "limited-palette effects (two inks, four greens)",
        "pixel banners and titles"
      ],
      "interaction": "Click for sparkles · drag the line to compare with the vector drawing",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "skin-seam",
          "why": "One simulation, a pixel-art skin among others"
        },
        {
          "id": "play-input",
          "why": "Input for a 2D game"
        },
        {
          "id": "brush-tips",
          "why": "Painting tools for the art"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "canvas2d",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-13",
          "gpuMs": null,
          "cpuMs": 2.313,
          "cpuP95Ms": 4.905,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the world stepping at 12 frames a second and a burst of 28 particles every 0.7 s (they move every frame), so the frames hold the drawing of the three planes at art resolution, the composite (ordered dither, palette snap and outline over about 130,000 art pixels a plane at 1920×1080 with 4 px art pixels) and the vector half of the comparison. At rest nothing is drawn."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 1.79,
          "cpuP95Ms": 3.67,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 55 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 3.62,
          "cpuP95Ms": 8.08,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 164 ms."
        }
      ],
      "signatures": [
        {
          "file": "font5x7.ts",
          "declarations": "export declare const GLYPH: {\n    readonly width: 5;\n    readonly height: 7;\n    readonly gap: 1;\n    readonly space: 3;\n};\nexport declare const hasGlyph: (ch: string) => boolean;\nexport declare function glyphCells(text: string): {\n    cells: Array<{\n        x: number;\n        y: number;\n    }>;\n    width: number;\n    height: number;\n};\nexport declare function drawBlockText(ctx: CanvasRenderingContext2D, text: string, x: number, y: number, { scale, colour, align, wave }?: {\n    scale?: number;\n    colour?: string;\n    align?: 'left' | 'center';\n    wave?: (column: number) => number;\n}): number;"
        },
        {
          "file": "palette.ts",
          "declarations": "export type Palette = {\n    hex: string[];\n    rgb: Uint8Array;\n    words: Uint32Array;\n    ink: number;\n};\nexport declare function parseHex(hex: string): [\n    number,\n    number,\n    number\n];\nexport declare function palette(hex: string[], ink?: number): Palette;\nexport declare function nearest(p: Palette, r: number, g: number, b: number): number;\nexport declare const LUT_BITS = 5;\nexport declare function paletteLut(p: Palette): Uint8Array;\nexport declare function lutKey(r: number, g: number, b: number): number;\nexport declare const BAYER4: Float32Array<ArrayBuffer>;\nexport declare const BAYER8: Float32Array<ArrayBuffer>;\nexport type DitherKind = 'bayer4' | 'bayer8' | 'none';\nexport declare function threshold(kind: DitherKind, x: number, y: number): number;\nexport declare function ditherMix<T>(a: T, b: T, k: number, x: number, y: number, kind?: DitherKind): T;"
        },
        {
          "file": "pixel-layer.ts",
          "declarations": "import { type ArtGrid } from './grid';\nimport { type CompositeStats, type PlaneSpec } from './composite';\nimport { type Palette } from './palette';\nexport type PixelLayerOptions = {\n    art?: number;\n    palette: string[];\n    ink?: number;\n    planes: PlaneSpec[];\n    clear?: number | null;\n    host?: HTMLElement;\n    onResize?: (grid: ArtGrid) => void;\n};\nexport type PixelPlane = {\n    ctx: CanvasRenderingContext2D;\n    spec: PlaneSpec;\n};\nexport type PixelLayer = {\n    readonly grid: ArtGrid;\n    readonly planes: PixelPlane[];\n    readonly palette: Palette;\n    readonly last: CompositeStats & {\n        ms: number;\n    };\n    render(from?: number): void;\n    clear(index?: number): void;\n    setArt(art: number): void;\n    setPalette(hex: string[], ink?: number): void;\n    setPlane(index: number, spec: Partial<PlaneSpec>): void;\n    toArt(clientX: number, clientY: number): {\n        x: number;\n        y: number;\n    };\n    resize(): void;\n    dispose(): void;\n};\nexport declare function createPixelLayer(canvas: HTMLCanvasElement, options: PixelLayerOptions): PixelLayer;"
        }
      ],
      "pitfalls": [
        "Pixel art needs every art pixel to be a whole number of device pixels",
        "Put the layer at a whole device pixel",
        "Each render reads the planes back with getImageData",
        "Planes are 2D contexts made with willReadFrequently, so they live on the CPU",
        "Resizing the host clears the planes (their canvases change size)",
        "Snapping to a palette uses a 15-bit table (5 bits a channel)",
        "Text in the picture is decoration",
        "The demo moves the world in steps (12 a second) like sprite animation"
      ],
      "card": "entries/pixel-art-layer.json"
    },
    {
      "id": "plants-burn",
      "aliases": [],
      "name": "Plants that burn and leave remains",
      "summary": "Plants that catch, burn and leave something behind, one at a time by a stable key: flowers and reeds flare, char and shrink to ash; bushes burn a few seconds, lose leaves and collapse to a charred heap; trees catch in the crown, char, drop embers, may light their neighbours, then break low down and hinge over, leaving a smouldering stump and a log. Rain stops new fires and puts small ones out; a downpour puts trees out, charred and standing, dead once most leaves are gone. In wind a wild fire runs the crowns downwind. The state is pure, seeded and tested, stepped on the CPU four times a second, and each plant’s look goes to its own instance row: char creeping from where the fire took hold with a glowing front, embers in the cracks, leaves burnt away in patches. The nearest burning crowns are drawn as a fluid fire on the GPU, the rest with cheap flame licks, and the fires light the ground and trunks round them.",
      "category": "simulation",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "expressive",
      "tags": [
        "fire",
        "wildfire",
        "cpu twin",
        "char front",
        "vegetation",
        "foliage",
        "trees",
        "bushes",
        "flowers",
        "burning",
        "char",
        "embers",
        "smoke",
        "ash",
        "remains",
        "felling",
        "rain",
        "wind",
        "crown fire",
        "state machine",
        "seeded",
        "deterministic",
        "instancing",
        "instance rows",
        "fluid",
        "volumetric",
        "particles",
        "dynamic lighting",
        "tsl",
        "webgl fallback",
        "no dependencies"
      ],
      "useCases": [
        "a torch, a campfire’s ember or a lightning strike setting a game’s plants alight",
        "a wildfire running through a wood, crown to crown, with the wind",
        "what is left after a fire: ash, charred heaps, stumps and logs, dead standing trees",
        "rain and downpours putting fires out, plant by plant",
        "a map-scale fire model feeding the plants near the player, and the plants reporting back",
        "burning crowns drawn as a fluid near the camera and as cheap flames far off",
        "warm firelight on the ground, trunks and smoke without a light object per fire"
      ],
      "interaction": "Hold the pointer on a plant to touch the torch to it · call lightning · drag in Look, or right-drag, to turn the view",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "brush-through",
          "why": "The same plants parting as things pass"
        },
        {
          "id": "fluid-fire",
          "why": "A real flame body for the big fires"
        },
        {
          "id": "wildfire",
          "why": "The fire map that decides what burns"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "mixed",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "The fluid crowns’ march leaves empty air unshaded; the sky is drawn after the copse (the same picture).",
          "low": "As medium, and the embers’ flicker on bark from the vertex stage (the same picture)."
        },
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 1.384,
          "cpuMs": 0.405,
          "cpuP95Ms": 0.79,
          "badge": "moderate",
          "drawCalls": 18,
          "computeDispatches": 1,
          "frames": {
            "clock": "paced",
            "p50Ms": 4.025,
            "p99Ms": 7.09,
            "low1Fps": 96.6
          },
          "notes": "Measured from a lightning strike on frame one: the upwind tree of the copse catches in its crown, with a 2.2 m/s wind and the crown run on, stepped a 60th of a second a frame (so the uncapped run burns as at 60 Hz). By the measured frames the fire has run into the neighbouring crowns: the nearest as the fluid box (30 × 40 × 30 cells, 40 ray steps), the rest with flame licks, embers, glows and smoke, the warm light of eight fires on every material, and the fire stepped on the CPU four times a second. The preview is posed: the copse ablaze in the crowns, held still."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 9.306,
          "cpuMs": 1.033,
          "cpuP95Ms": 1.81,
          "badge": "heavy",
          "drawCalls": 18,
          "computeDispatches": 1,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 4878 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 10.654,
          "cpuMs": 0.12,
          "cpuP95Ms": 0.32,
          "badge": "heavy",
          "drawCalls": 18,
          "computeDispatches": 1,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 299 ms."
        }
      ],
      "signatures": [
        {
          "file": "burn-look.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\nimport type { Fell } from './fall';\nimport type { BurnLook } from './plant-fire';\ntype F = Node<'float'>;\ntype V3 = Node<'vec3'>;\ntype V4 = Node<'vec4'>;\nexport declare class BurnRows {\n    readonly count: number;\n    readonly look: THREE.InstancedBufferAttribute;\n    readonly fall: THREE.InstancedBufferAttribute | null;\n    constructor(count: number, options?: {\n        fall?: boolean;\n    });\n    reset(): void;\n    set(row: number, look: Pick<BurnLook, 'char' | 'glow' | 'leaves' | 'squash' | 'gone'>): void;\n    setFall(row: number, fell: Fell | null): void;\n    flush(): void;\n    nodes(): {\n        look: V4;\n        fall: V4 | null;\n    };\n}\nexport type Slump = 'shrink' | 'collapse' | 'stand';\nexport declare function burnMove(o: {\n    offset: V3;\n    look: V4;\n    slump: Slump;\n    fall?: V4 | null;\n    now?: F;\n}): V3;\nexport declare const CHAR: THREE.Color;\nexport declare const CHAR_FLAKED: THREE.Color;\nexport declare const SINGED: THREE.Color;\nexport declare const LEAF_CHARRED: THREE.Color;\nexport declare const EMBER: THREE.Color;\nexport declare const CRACK: THREE.Color;\nexport declare const FRONT: THREE.Color;\nexport declare function burnSurface(o: {\n    albedo: V3;\n    at: V3;\n    rise: F;\n    from: F | number;\n    leaf: F | number;\n    look: V4;\n    time: F;\n    coarse?: V3;\n    vertexFlicker?: boolean;\n}): {\n    colour: V3;\n    light: V3;\n};\nexport declare function burnNoise(o: {\n    at: V3;\n    look: V4;\n    time: F;\n}): V4;\nexport declare function leavesKept(o: {\n    at: V3;\n    leaf: F | number;\n    look: V4;\n    noise?: F;\n}): Node<\"bool\">;\nexport declare const litByFire: (colour: V3, embers: V3, glow: V3) => V3;\nexport declare const atLeast0: (x: V3) => V3;\nexport {};"
        },
        {
          "file": "char-front.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { type Fell } from './fall';\nimport type { BurnLook } from './plant-fire';\nexport declare function pcg(v: number): number;\nexport declare function charNoise(x: number, y: number, z: number): number;\nexport declare const charNoiseNode: THREE.TSL.FnNode<[\n    THREE.Node<\"vec3\"> | THREE.Vector3\n], THREE.Node<\"float\">>;\nexport declare const CHAR_BROAD = 1.7, CHAR_FINE = 7.3;\nexport declare const LEAF_PATCH = 1.9;\nexport declare const charAway: (rise: number, from: number, broad: number, fine: number) => number;\nexport declare const charAwayNode: THREE.TSL.FnNode<[\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">,\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">,\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">,\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">\n], THREE.Node<\"float\">>;\nexport declare function charBands(away: number, char: number): {\n    charred: number;\n    front: number;\n};\nexport declare const charBandsNode: THREE.TSL.FnNode<[\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">,\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">\n], THREE.JoinNode<\"vec2\">>;\nexport declare function charAt(at: {\n    x: number;\n    y: number;\n    z: number;\n}, rise: number, from: number, char: number): {\n    charred: number;\n    front: number;\n};\nexport declare const leafKept: (at: {\n    x: number;\n    y: number;\n    z: number;\n}, leaves: number) => boolean;\nexport declare class FrontSites {\n    readonly points: Float32Array;\n    readonly leaf: Uint8Array;\n    readonly count: number;\n    constructor(geometry: THREE.BufferGeometry, options?: {\n        leaf?: (index: number) => boolean;\n        count?: number;\n    });\n}\nexport type BurningShape = {\n    x: number;\n    y: number;\n    z: number;\n    height: number;\n    turn: number;\n    wide: number;\n    from: number;\n};\nexport type SlumpKind = 'shrink' | 'collapse' | 'stand';\nexport declare function edgePoint(o: {\n    sites: FrontSites;\n    shape: BurningShape;\n    look: Pick<BurnLook, 'char' | 'leaves' | 'squash'>;\n    slump: SlumpKind;\n    fell?: Fell | null;\n    now?: number;\n    random: () => number;\n    tries?: number;\n    out: {\n        x: number;\n        y: number;\n        z: number;\n    };\n}): {\n    rise: number;\n    front: number;\n} | null;"
        },
        {
          "file": "crown-volume.ts",
          "declarations": "import type * as THREE from 'three/webgpu';\nimport { FireVolume, type FireBurner, type FireKnobs, type FireVolumeSettings } from './fire-volume';\nimport type { FlamingPlant } from './plant-fire';\nexport declare const CROWN_RANGE = 70;\ntype Box = {\n    x: number;\n    y: number;\n    z: number;\n};\nexport declare function burnerOf(f: FlamingPlant, out: FireBurner): FireBurner | null;\nexport declare function crownScore(f: FlamingPlant, anchor?: string): number;\nexport declare function fits(corner: Box, b: FireBurner, settings?: FireVolumeSettings): boolean;\nexport declare function holds(corner: Box, b: FireBurner, settings?: FireVolumeSettings): boolean;\nexport declare function crownBox(burners: readonly FireBurner[], settings?: FireVolumeSettings): Box;\nexport declare class PlantFireVolume {\n    readonly volume: FireVolume;\n    constructor(ground: (x: number, z: number) => number, settings?: FireVolumeSettings, knobs?: Partial<FireKnobs>, options?: {\n        fallenToLicks?: boolean;\n    });\n    get count(): number;\n    get flaming(): boolean;\n    get lingering(): number;\n    take(flaming: readonly FlamingPlant[]): void;\n    update(renderer: THREE.WebGPURenderer, dt: number, camera: THREE.Camera, wind?: {\n        x: number;\n        z: number;\n    }): void;\n    warm(renderer: THREE.WebGPURenderer, drawn?: (mesh: THREE.Mesh) => Promise<unknown>): Promise<void>;\n    clear(): void;\n    dispose(): void;\n}\nexport {};"
        },
        {
          "file": "fall.ts",
          "declarations": "import type { Node } from 'three/webgpu';\nimport type { FallingCrown, FirePlant } from './plant-fire';\ntype F = Node<'float'>;\ntype V3 = Node<'vec3'>;\ntype V4 = Node<'vec4'>;\nexport declare const FALL_ANGLE = 1.45;\nexport declare const fallSeconds: (height: number) => number;\nexport declare const CROWN_MIDDLE = 0.68;\nexport type Fell = {\n    yaw: number;\n    cut: number;\n    start: number;\n    seconds: number;\n};\nexport declare const fellAt: (plant: Pick<FirePlant, \"height\">, yaw: number, cut: number, now: number) => Fell;\nexport declare const fallAngle: (fell: Pick<Fell, \"start\" | \"seconds\">, now: number) => number;\nexport declare const downFor: (fell: Pick<Fell, \"start\" | \"seconds\">, now: number) => number;\nexport declare function fallPoint(p: {\n    x: number;\n    y: number;\n    z: number;\n}, yaw: number, cut: number, angle: number, out: {\n    x: number;\n    y: number;\n    z: number;\n}): {\n    x: number;\n    y: number;\n    z: number;\n};\nexport declare function fallNode(offset: V3, row: V4, now: F): V3;\nexport declare function crownOf(plant: Pick<FirePlant, 'x' | 'y' | 'z' | 'height'>, fell: Fell, now: number, out: FallingCrown): FallingCrown;\nexport {};"
        },
        {
          "file": "fire-glow.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node, UniformArrayNode } from 'three/webgpu';\ntype F = Node<'float'>;\ntype V3 = Node<'vec3'>;\nexport declare const GLOWS = 8;\nexport declare const FIRE_LIGHT: THREE.Color;\nexport type Glow = {\n    x: number;\n    y: number;\n    z: number;\n    power: number;\n    reach: number;\n    core?: number;\n};\nexport declare function pickGlows(fires: readonly Glow[], focus: {\n    x: number;\n    z: number;\n}, max?: number, out?: Glow[]): Glow[];\nexport declare const glowFalloff: (power: number, reach: number, d: number, core?: number) => number;\nexport declare class FireGlow {\n    readonly at: UniformArrayNode<'vec4'>;\n    readonly reach: UniformArrayNode<'vec4'>;\n    readonly count: THREE.UniformNode<\"int\", number>;\n    readonly colour: THREE.UniformNode<\"color\", THREE.Color>;\n    constructor();\n    set(glows: readonly Glow[], flicker?: (index: number) => number): void;\n    light(position: V3, normal: V3 | null, wrap?: number | F): V3;\n}\nexport {};"
        },
        {
          "file": "fire-volume.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { ComputeNode } from 'three/webgpu';\nexport type FireVolumeSettings = {\n    nx: number;\n    ny: number;\n    nz: number;\n    cell: number;\n    burners?: number;\n    steps?: number;\n    jacobi?: number;\n    fine?: boolean;\n    tongues?: number;\n    scale?: number;\n    sparse?: boolean;\n};\nexport type FireBurner = {\n    x: number;\n    y: number;\n    z: number;\n    rx: number;\n    ry: number;\n    rz: number;\n    strength: number;\n};\nexport declare const FIRE_VOLUME: FireVolumeSettings;\nexport declare const CROWN_VOLUME: FireVolumeSettings;\nexport declare const CROWN_KNOBS: Partial<FireKnobs>;\nexport declare const FIRE_KNOBS: {\n    readonly buoyancy: {\n        readonly label: \"Lift\";\n        readonly min: 0;\n        readonly max: 30;\n        readonly step: 0.1;\n        readonly recommended: 11;\n        readonly hint: \"How hard hot air rises: tall flames and a rising plume, or low creeping fire.\";\n    };\n    readonly turbulence: {\n        readonly label: \"Turbulence\";\n        readonly min: 0;\n        readonly max: 30;\n        readonly step: 0.5;\n        readonly recommended: 12;\n        readonly hint: \"How much the flow curls into folds and wisps (the fluid look).\";\n    };\n    readonly cooling: {\n        readonly label: \"Cooling\";\n        readonly min: 0.2;\n        readonly max: 6;\n        readonly step: 0.05;\n        readonly recommended: 1.5;\n        readonly hint: \"How fast heat dies as it rises: short flames, or tall ones.\";\n    };\n    readonly smoke: {\n        readonly label: \"Smoke\";\n        readonly min: 0;\n        readonly max: 3;\n        readonly step: 0.05;\n        readonly recommended: 1;\n        readonly hint: \"How much smoke the fire gives off.\";\n    };\n    readonly smokeLife: {\n        readonly label: \"Smoke lasts\";\n        readonly unit: \"s\";\n        readonly min: 0.5;\n        readonly max: 20;\n        readonly step: 0.5;\n        readonly recommended: 6;\n        readonly hint: \"How long smoke lingers before it thins away.\";\n    };\n    readonly detail: {\n        readonly label: \"Detail\";\n        readonly min: 0;\n        readonly max: 2;\n        readonly step: 0.05;\n        readonly recommended: 1;\n        readonly hint: \"Fine turbulence finer than the simulation: ragged tongues and wisps at the edges, or a smooth body.\";\n    };\n    readonly glow: {\n        readonly label: \"Glow\";\n        readonly min: 0;\n        readonly max: 8;\n        readonly step: 0.1;\n        readonly recommended: 3.2;\n        readonly hint: \"How bright the flames are.\";\n    };\n    readonly darkness: {\n        readonly label: \"Smoke darkness\";\n        readonly min: 0;\n        readonly max: 6;\n        readonly step: 0.1;\n        readonly recommended: 2.4;\n        readonly hint: \"How dark and thick the smoke reads.\";\n    };\n    readonly crownHeat: {\n        readonly label: \"Crown heat\";\n        readonly min: 0;\n        readonly max: 30;\n        readonly step: 0.25;\n        readonly recommended: 16;\n        readonly hint: \"Burning crowns only: how hard a crown feeds the fire (a glowing body, or flames licking out of it).\";\n    };\n    readonly crownClumps: {\n        readonly label: \"Crown clumps\";\n        readonly min: 0;\n        readonly max: 1;\n        readonly step: 0.05;\n        readonly recommended: 0.8;\n        readonly hint: \"Burning crowns only: the crown burns in patches that flare and move (tongues breaking out) rather than all through (a ball).\";\n    };\n    readonly crownDraught: {\n        readonly label: \"Crown updraft\";\n        readonly min: 0;\n        readonly max: 30;\n        readonly step: 0.5;\n        readonly recommended: 6;\n        readonly hint: \"Burning crowns only: how hard the burning crown throws its flames up out of its top.\";\n    };\n};\nexport type FireKnobs = {\n    [K in keyof typeof FIRE_KNOBS]: number;\n};\nexport declare const fireKnobDefaults: () => FireKnobs;\nexport declare const FIRE_QUALITY: {\n    readonly game: {\n        readonly cellScale: 1;\n        readonly steps: 80;\n        readonly jacobi: 20;\n        readonly knobs: Partial<FireKnobs>;\n    };\n    readonly stage: {\n        readonly cellScale: 0.5;\n        readonly steps: 160;\n        readonly jacobi: 40;\n        readonly knobs: Partial<FireKnobs>;\n    };\n};\nexport type FireQuality = keyof typeof FIRE_QUALITY;\nexport declare function fireSettings(base: FireVolumeSettings, quality?: FireQuality): FireVolumeSettings;\nexport declare class FireVolume {\n    readonly mesh: THREE.Mesh;\n    readonly settings: FireVolumeSettings;\n    readonly source: THREE.DataTexture;\n    readonly origin: THREE.UniformNode<\"vec3\", THREE.Vector3>;\n    readonly wind: THREE.UniformNode<\"vec3\", THREE.Vector3>;\n    constructor(settings?: FireVolumeSettings);\n    place(corner: THREE.Vector3Like): void;\n    reset(): void;\n    warm(renderer: THREE.WebGPURenderer, drawn?: (mesh: THREE.Mesh) => Promise<unknown>): Promise<void>;\n    passes(): ComputeNode[];\n    shift(dx: number, dz: number): void;\n    setBurners(burners: readonly FireBurner[]): void;\n    setKnobs(knobs: Partial<FireKnobs>): void;\n    update(renderer: THREE.WebGPURenderer, dt: number, camera?: THREE.Camera): void;\n    layers(renderer: THREE.WebGPURenderer): Promise<number[][]>;\n    dispose(): void;\n}"
        },
        {
          "file": "flames.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\nimport { type PlantFlame } from './plant-fire';\ntype V3 = Node<'vec3'>;\ntype Vec3 = {\n    x: number;\n    y: number;\n    z: number;\n};\nexport declare const FLAME_LOOK: {\n    readonly stretch: 1.7;\n    readonly windLean: 0.55;\n    readonly burst: 14;\n    readonly drift: 0.25;\n};\nexport type FireParticleOptions = {\n    bright?: number;\n    smoke?: number;\n    seed?: number;\n    smokeLight?: (at: V3) => V3;\n};\nexport declare class FireParticles {\n    readonly object: THREE.Group<THREE.Object3DEventMap>;\n    readonly clock: THREE.UniformNode<\"float\", number>;\n    readonly wind: THREE.UniformNode<\"vec3\", THREE.Vector3>;\n    readonly ambient: THREE.UniformNode<\"color\", THREE.Color>;\n    constructor(options?: FireParticleOptions);\n    get now(): number;\n    lick(at: Vec3, velocity: Vec3, style: PlantFlame): void;\n    embers(at: Vec3, count?: number, speed?: number): void;\n    glow(at: Vec3, size: number, strength: number, life?: number): void;\n    smoke(at: Vec3, size: number, life: number, opacity: number, rise?: number): void;\n    update(dt: number): void;\n    clear(): void;\n    dispose(): void;\n}\nexport {};"
        },
        {
          "file": "plant-fire.ts",
          "declarations": "export type PlantFuel = 'small' | 'bush' | 'tree';\ntype Vec3 = {\n    x: number;\n    y: number;\n    z: number;\n};\nexport type FirePlant = {\n    key: string;\n    kind: PlantFuel;\n    x: number;\n    y: number;\n    z: number;\n    height: number;\n    crown: number;\n    group?: number;\n    row?: number;\n    build?: number;\n};\nexport type Remains = 'ash' | 'heap' | 'stump' | 'standing';\nexport type FireLook = {\n    char: number;\n    glow: number;\n    leaves: number;\n};\nexport type BurnLook = FireLook & {\n    squash: number;\n    gone: boolean;\n    spent: boolean;\n    left?: Remains;\n    replaced?: boolean;\n};\nexport type Exposure = {\n    x: number;\n    y: number;\n    z: number;\n    r: number;\n    heat: number;\n    wild?: boolean;\n};\nexport type PlantFlame = {\n    life: number;\n    size: number;\n    grow: number;\n    buoyancy: number;\n    brightness: number;\n};\nexport type FlamingPlant = {\n    plant: FirePlant;\n    flames: number;\n    squash: number;\n    near: number;\n    fluid: boolean;\n    crown?: FallingCrown | null;\n};\nexport type FallingCrown = {\n    x: number;\n    y: number;\n    z: number;\n    lean: number;\n};\nexport interface PlantFireHost {\n    find(spheres: readonly Exposure[], count: number, out: FirePlant[]): number;\n    burnt(key: string): BurnLook | undefined;\n    show(plant: FirePlant, look: BurnLook): void;\n    fell(plant: FirePlant, yaw: number, cut: number): boolean;\n    crownAt?(plant: FirePlant, out: FallingCrown): boolean;\n    flame(at: Vec3, velocity: Vec3, style: PlantFlame, plant?: FirePlant): void;\n    edge?(plant: FirePlant, look: BurnLook, out: Vec3): boolean;\n    spark?(at: Vec3, plant: FirePlant): void;\n    fluid?(flaming: readonly FlamingPlant[]): void;\n    smoke(at: Vec3, size: number, life: number, opacity: number, plant?: FirePlant): void;\n    embers(at: Vec3, plant?: FirePlant): void;\n    wet(): number;\n    focus(): Vec3;\n    light?(key: string, light: {\n        color: string;\n        intensity: number;\n        range: number;\n        flicker: number;\n    } | null, at?: readonly [\n        number,\n        number,\n        number\n    ]): void;\n    wind?(): {\n        x: number;\n        z: number;\n    };\n}\nexport declare const TICK = 0.25;\nexport declare const BURN_CAP: Record<PlantFuel, number>;\nexport declare const EXPOSURE_CAP = 16;\nexport declare const FLAME_PLANTS = 16;\nexport declare const FLAME_RATE = 240;\nexport declare const FLAME_RANGE = 90;\nexport declare const SMOKE_RATE = 8;\nexport declare const CATCH: Record<PlantFuel, number>;\nexport declare const MIN_HEAT = 0.2;\nexport declare const SMALL_FLARE = 0.6;\nexport declare const SMALL_CHAR = 1.4;\nexport declare const BUSH_CATCH = 1;\nexport declare const BUSH_BURN: readonly [\n    number,\n    number\n];\nexport declare const BUSH_COLLAPSE = 1.5;\nexport declare const BUSH_HEAP = 0.18;\nexport declare const BUSH_LEAVES = 0.5;\nexport declare const TREE_CATCH = 3;\nexport declare const TREE_BURN: readonly [\n    number,\n    number\n];\nexport declare const TREE_SMOULDER = 20;\nexport declare const TREE_FALL_GLOW = 2.3;\nexport declare const TREE_FALL_FLAMES = 6;\nexport declare const TREE_BREAK: readonly [\n    number,\n    number\n];\nexport declare const SPREAD_REACH = 4;\nexport declare const SPREAD_CHANCE: Record<PlantFuel, number>;\nexport declare const CROWN_RUN: {\n    readonly reach: 10;\n    readonly down: Record<PlantFuel, number>;\n    readonly across: Record<PlantFuel, number>;\n    readonly breeze: 1.2;\n    readonly gale: 2.5;\n    readonly cap: Record<PlantFuel, number>;\n};\nexport declare const SPREAD_EVERY = 1;\nexport declare const EMBERS_EVERY = 1.8;\nexport declare const RAIN_STOPS = 0.3;\nexport declare const RAIN_DOUSES = 0.5;\nexport declare const RAIN_DOUSES_TREES = 0.85;\nexport declare const DOUSED_DEAD = 0.6;\nexport declare const PLANT_FIRE_KNOBS: {\n    readonly flameRate: {\n        readonly label: \"Flames a second\";\n        readonly min: 40;\n        readonly max: 800;\n        readonly step: 10;\n        readonly unit: \"/s\";\n        readonly recommended: 300;\n        readonly hint: \"Tongues of flame a second over every plant burning, shared out between them: the far flames’ budget. The source game’s 240 drew whole licks; split into tongues of the same area all told, a quarter more keeps a burning edge full.\";\n    };\n    readonly smallFlames: {\n        readonly label: \"Flower flames\";\n        readonly min: 0;\n        readonly max: 60;\n        readonly step: 1;\n        readonly unit: \"/s\";\n        readonly recommended: 12;\n        readonly hint: \"Tongues a second on a small plant at full flame (the source game: 8 licks).\";\n    };\n    readonly bushFlames: {\n        readonly label: \"Bush flames\";\n        readonly min: 0;\n        readonly max: 120;\n        readonly step: 1;\n        readonly unit: \"/s\";\n        readonly recommended: 34;\n        readonly hint: \"Tongues a second on a bush at full flame (the source game: 18 licks).\";\n    };\n    readonly treeFlames: {\n        readonly label: \"Tree flames\";\n        readonly min: 0;\n        readonly max: 160;\n        readonly step: 1;\n        readonly unit: \"/s\";\n        readonly recommended: 50;\n        readonly hint: \"Tongues a second on a tree’s crown at full flame, the fluid taking the nearest (the source game: 28 licks).\";\n    };\n    readonly tongues: {\n        readonly label: \"Tongues a flame\";\n        readonly min: 1;\n        readonly max: 5;\n        readonly step: 1;\n        readonly unit: \"\";\n        readonly recommended: 3;\n        readonly hint: \"Each flame on the burning edge splits into this many smaller tongues round it, each with its own life: a ragged edge of fire, not one big lick.\";\n    };\n    readonly flameSize: {\n        readonly label: \"Flame size\";\n        readonly min: 0.4;\n        readonly max: 2;\n        readonly step: 0.05;\n        readonly unit: \"\";\n        readonly recommended: 1;\n        readonly hint: \"Every tongue's size, as a share of the source game's.\";\n    };\n    readonly smokeRate: {\n        readonly label: \"Smoke a second\";\n        readonly min: 0;\n        readonly max: 30;\n        readonly step: 1;\n        readonly unit: \"/s\";\n        readonly recommended: 8;\n        readonly hint: \"Smoke puffs a second over every plant burning.\";\n    };\n    readonly smallSmoke: {\n        readonly label: \"Smoke off flowers\";\n        readonly min: 0;\n        readonly max: 1;\n        readonly step: 0.05;\n        readonly unit: \"\";\n        readonly recommended: 0.35;\n        readonly hint: \"The share of a puff a small plant sends up when it is drawn for one (the source game sent none: a flower then burnt with no smoke at all).\";\n    };\n    readonly sparks: {\n        readonly label: \"Sparks\";\n        readonly min: 0;\n        readonly max: 1;\n        readonly step: 0.05;\n        readonly unit: \"\";\n        readonly recommended: 0.2;\n        readonly hint: \"The share of tongues that throw a spark up and downwind.\";\n    };\n    readonly smallSeconds: {\n        readonly label: \"Flower burns for\";\n        readonly min: 1;\n        readonly max: 10;\n        readonly step: 0.25;\n        readonly unit: \"s\";\n        readonly recommended: 4.5;\n        readonly hint: \"A flower or reed from catching to ash. The source game's 2 s reads as a pop; a front creeping down a stem needs four or five.\";\n    };\n};\nexport type PlantFireKnobs = {\n    -readonly [K in keyof typeof PLANT_FIRE_KNOBS]: number;\n};\nexport declare const PLANT_FIRE_RECOMMENDED: PlantFireKnobs;\nexport declare const PLANT_FIRE_QUALITY: Record<'high' | 'low', Partial<PlantFireKnobs>>;\nexport type PlantFireQuality = keyof typeof PLANT_FIRE_QUALITY;\nexport type BurnPhase = 'flare' | 'catching' | 'burning' | 'collapsing' | 'smoulder' | 'spent' | 'gone';\nexport declare function burnPhase(kind: PlantFuel, t: number, life: number, look: BurnLook): {\n    phase: BurnPhase;\n    flames: number;\n};\nexport declare function catchChance(kind: PlantFuel, heat: number, wet: number): number;\nexport declare function spreadChance(kind: PlantFuel, wet: number): number;\nexport declare function crownChance(kind: PlantFuel, wet: number, run: number): number;\nexport declare const doused: (kind: PlantFuel, wet: number) => boolean;\nexport declare function seeded(seed: number): () => number;\nexport declare class BurntPlants {\n    readonly records: Map<string, BurnLook>;\n    get(key: string): BurnLook | undefined;\n    set(key: string, look: BurnLook): void;\n    clear(): void;\n    get size(): number;\n}\nexport declare const FIND_CAP = 256;\nexport declare class PlantFires {\n    readonly knobs: PlantFireKnobs;\n    constructor(host: PlantFireHost, random?: () => number, options?: {\n        knobs?: Partial<PlantFireKnobs>;\n        quality?: PlantFireQuality;\n    });\n    setKnobs(knobs: Partial<PlantFireKnobs>): void;\n    setQuality(quality: PlantFireQuality): void;\n    count(kind?: PlantFuel, wild?: boolean): number;\n    get smouldering(): number;\n    state(key: string): {\n        phase: BurnPhase;\n        look: BurnLook;\n        flames: number;\n        life: number;\n        wild: boolean;\n    } | undefined;\n    get flamingCount(): number;\n    get exposureCount(): number;\n    get now(): number;\n    expose(at: Vec3, radius: number, heat: number, wild?: boolean): void;\n    ignite(plant: FirePlant, wild?: boolean): boolean;\n    update(dt: number): void;\n    clear(): void;\n    dispose(): void;\n    douse(at: Vec3, radius: number): number;\n}\nexport {};"
        },
        {
          "file": "remains-draw.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\nimport { type AshLaid, type Piece, type Placed } from './remains';\ntype F = Node<'float'>;\ntype V2 = Node<'vec2'>;\ntype V3 = Node<'vec3'>;\nexport declare const EMBER_GLOW = 2.5;\nexport declare const EMBER_FADE = 20;\nexport declare function pieceGeometry(piece: Piece, seed?: number): THREE.BufferGeometry;\nexport declare class AshGround {\n    readonly x0: number;\n    readonly z0: number;\n    readonly size: number;\n    readonly cells: number;\n    readonly texture: THREE.DataTexture;\n    constructor(x0: number, z0: number, size: number, cells?: number);\n    lay(a: AshLaid): void;\n    char(x: number, z: number, radius: number, amount: number): void;\n    clear(): void;\n    dispose(): void;\n    flush(): void;\n    at(xz: V2): V2;\n    read(x: number, z: number): {\n        ash: number;\n        char: number;\n    };\n}\nexport declare class RemainsDraw {\n    readonly object: THREE.Group<THREE.Object3DEventMap>;\n    constructor(o: {\n        clock: F;\n        light?: (at: V3, normal: V3) => V3;\n        ground?: (xz: V2) => V3;\n        skip?: Piece[];\n        room?: number;\n        seed?: number;\n    });\n    count(piece?: Piece): number;\n    has(key: string): boolean;\n    set(key: string, pieces: Placed[]): void;\n    remove(key: string): void;\n    clear(): void;\n    update(): void;\n    showAll(at: {\n        x: number;\n        y: number;\n        z: number;\n    }): void;\n    dispose(): void;\n}\nexport {};"
        },
        {
          "file": "remains.ts",
          "declarations": "import type { Remains } from './plant-fire';\nexport type Piece = 'ashHeap' | 'bushSmall' | 'bushLarge' | 'standing' | 'stump' | 'log';\nexport declare const PIECES: readonly Piece[];\nexport declare const KIT: {\n    readonly tree: 7.5;\n    readonly stump: 0.6;\n    readonly stumpTrunk: 0.5;\n    readonly log: 3;\n    readonly logThick: 0.53;\n    readonly heap: 1;\n    readonly heapTall: 0.13;\n    readonly bushSmall: 0.45;\n    readonly bushLarge: 0.88;\n};\nexport declare const BUSH_SMALL_BELOW = 0.75;\nexport declare const BUSH_BRANCHES = 0.8;\nexport declare const HEAP_FLAT = 0.07;\nexport declare const HEAP_BUSH_EMBERS = 0.6;\nexport declare const LOG_REACH = 0.7;\nexport type Placed = {\n    piece: Piece;\n    x: number;\n    y: number;\n    z: number;\n    q: [\n        number,\n        number,\n        number,\n        number\n    ];\n    s: [\n        number,\n        number,\n        number\n    ];\n    embers: number;\n    shape?: number;\n};\nexport type AshLaid = {\n    x: number;\n    z: number;\n    radius: number;\n    amount: number;\n};\nexport type BurntPlant = {\n    key: string;\n    x: number;\n    y: number;\n    z: number;\n    height: number;\n    crown: number;\n};\nexport type Fall = {\n    yaw: number;\n    cut: number;\n};\nexport declare function keyNoise(key: string, salt?: number): number;\nexport declare function ashOf(left: Remains, plant: BurntPlant, pieces?: readonly Placed[]): AshLaid[];\nexport declare function logOf(plant: BurntPlant, fall: Fall, diameter: number): {\n    x: number;\n    y: number;\n    z: number;\n    length: number;\n    rise: number;\n};\nexport declare function remainsOf(left: Remains, plant: BurntPlant, ground: (x: number, z: number) => number, tree?: {\n    fall: Fall;\n    diameter: number;\n    embers: number;\n}, heapEmbers?: number): Placed[];"
        }
      ],
      "pitfalls": [
        "Step the fire a few times a second, not every frame (TICK, 0.25 s)",
        "Key every plant by something stable (its chunk and placement, not its index in a rebuilt list)",
        "Never use Math.random for the fire",
        "Write a plant’s look to its row only when the fire’s step shows it",
        "Work the fires’ light out per vertex on anything large or dense on screen",
        "Leaves take their burn’s noise from the vertex stage too",
        "Light the flames where the char is creeping, on the plant’s own stems and leaves (`edgePoint`)",
        "Split each flame into smaller tongues anchored where they were lit",
        "A WGSL function cannot take a parameter called `from` (a reserved word)",
        "Keep the char’s glowing front thin and its embers a deep orange",
        "A plant’s draw may use eight vertex buffers",
        "A box of fluid fed by whole crown ellipsoids reads as a soft glowing ball",
        "The fluid costs by how much of the screen its box covers",
        "Swap a felled tree for its stump and log only once its crown’s flames are out",
        "An instanced mesh first drawn with no instances may never draw later ones (three r185 to r187)",
        "Wetness is the ground’s, not only the rain",
        "A lightning strike must not strobe",
        "A sky drawn first with depth writes off shades every pixel"
      ],
      "card": "entries/plants-burn.json"
    },
    {
      "id": "play-input",
      "aliases": [],
      "name": "Play input for couch and party games",
      "summary": "The input and onboarding layer of a party game. Keys, a gamepad and touch drive one seat each, switching by whichever was used last, and the hint glyphs follow. On touch a stick floats under the first finger, its base following past its reach, beside an action button with its own pointer. A press is latched until the next fixed tick has seen it, so the shortest tap counts. Every tick each seat sends a quantised { mx, my, b }, three bytes, into fixed 60 Hz lockstep steps, from a person’s device, a bot or the network alike, so a session can be sent, checked against a twin and replayed exactly from its recorded inputs. Pads you stand on to vote, a practice that ends once everyone has tried the action, and a field camera that fits a fixed 2D field into a box minus its bars, turns it on its side in portrait, zooms about a point and pinches about the fingers’ midpoint.",
      "category": "ui",
      "role": "interaction",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "input",
        "game input",
        "party game",
        "couch multiplayer",
        "local multiplayer",
        "keyboard",
        "gamepad",
        "Gamepad API",
        "touch",
        "virtual stick",
        "floating stick",
        "device switching",
        "input hints",
        "button prompts",
        "input latch",
        "fixed step",
        "lockstep",
        "deterministic",
        "replay",
        "netcode",
        "bots",
        "onboarding",
        "tutorial",
        "practice round",
        "voting",
        "pinch zoom",
        "portrait",
        "camera",
        "seeded",
        "canvas 2d",
        "accessibility",
        "reduced motion",
        "no dependencies"
      ],
      "useCases": [
        "a couch or party game in the browser, where each seat may be keys, a gamepad or a phone",
        "touch controls for any top-down or arena game: a stick wherever the thumb lands and a button beside it",
        "button prompts that follow whatever the player picked up last",
        "a fixed-step game that can be networked in lockstep, checked against a second machine and replayed from its inputs",
        "bots that play through the same messages a person would, so a lobby is never empty",
        "onboarding by doing: a practice that ends once everyone has tried the action, and votes taken by standing on a pad",
        "a fixed 2D board or field fitted to any screen, turned for phones in portrait, with zoom and pinch"
      ],
      "interaction": "Move with WASD, the arrows, a gamepad or a finger · Space dashes · stand on a pad to vote · R replays",
      "kits": [
        {
          "kit": "game",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "game-cameras",
          "why": "Cameras its sticks and mouse drive"
        },
        {
          "id": "keyboard-shortcuts",
          "why": "Rebinding in the settings"
        },
        {
          "id": "race-car",
          "why": "Steering, throttle and brake from any device"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "canvas2d",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": null,
          "cpuMs": 0.3,
          "cpuP95Ms": 0.53,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.855,
            "p99Ms": 18.055,
            "low1Fps": 54.7
          },
          "notes": "Measured with four bots from the first frame, starting at the practice: each frame runs exactly one 60 Hz tick (the run is uncapped, so real time would give a tick only every few frames), steps the twin machine from the encoded bytes, hashes both, and draws the field, the tokens, their trails and the lamps in Canvas 2D through the field camera. No GPU of its own."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.425,
          "cpuP95Ms": 0.825,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 40 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.9,
          "cpuP95Ms": 1.8,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 154 ms."
        }
      ],
      "signatures": [
        {
          "file": "field-cam-dom.ts",
          "declarations": "import type { FieldCam, Insets } from './field-cam';\nexport type FieldGestures = 'none' | 'pinch' | 'pan-pinch';\nexport type FieldCamDomOptions = {\n    insets?(rect: DOMRect): Insets;\n    gestures?: FieldGestures;\n    wheel?: boolean;\n    onChange?(): void;\n    ignore?(target: Element): boolean;\n};\nexport type FieldCamDom = {\n    gestures: FieldGestures;\n    refit(): void;\n    dispose(): void;\n};\nexport declare function attachFieldCam(el: HTMLElement, cam: FieldCam, o?: FieldCamDomOptions): FieldCamDom;"
        },
        {
          "file": "field-cam.ts",
          "declarations": "export type Insets = {\n    l?: number;\n    t?: number;\n    r?: number;\n    b?: number;\n};\nexport type FieldView = {\n    scale: number;\n    ox: number;\n    oy: number;\n    turned: boolean;\n};\nexport type FieldCamOptions = {\n    fw: number;\n    fh: number;\n    pad?: number;\n    maxZoom?: number;\n    calm?: boolean;\n    turn?: boolean;\n};\nexport type FieldCam = {\n    readonly view: FieldView;\n    readonly zoom: number;\n    readonly turned: boolean;\n    readonly clear: {\n        left: number;\n        top: number;\n        right: number;\n        bottom: number;\n        w: number;\n        h: number;\n    };\n    calm: boolean;\n    fit(width: number, height: number, insets?: Insets): FieldView;\n    toScreen(x: number, y: number): [\n        number,\n        number\n    ];\n    toField(sx: number, sy: number): [\n        number,\n        number\n    ];\n    matrix(): [\n        number,\n        number,\n        number,\n        number,\n        number,\n        number\n    ];\n    inputToField(dx: number, dy: number): [\n        number,\n        number\n    ];\n    zoomTo(z: number, o?: {\n        at?: [\n            number,\n            number\n        ] | null;\n        now?: boolean;\n    }): void;\n    zoomOn(z: number, x: number, y: number, o?: {\n        now?: boolean;\n    }): void;\n    panBy(dx: number, dy: number): void;\n    pinch(a0: P, b0: P, a1: P, b1: P): void;\n    update(dt: number): boolean;\n    target(): number;\n    px(len: number, z?: number): number;\n};\ntype P = {\n    x: number;\n    y: number;\n};\nexport declare function createFieldCam(o: FieldCamOptions): FieldCam;\nexport type Rect = {\n    left: number;\n    top: number;\n    right: number;\n    bottom: number;\n};\nexport declare function insetsAround(box: Rect, overlays: readonly Rect[], fw: number, fh: number, o?: {\n    turn?: boolean;\n    gap?: number;\n    pad?: number;\n}): Insets;\nexport {};"
        },
        {
          "file": "hints.ts",
          "declarations": "export type Device = 'keys' | 'pad' | 'touch';\nexport type KeyMap = {\n    up: string[];\n    down: string[];\n    left: string[];\n    right: string[];\n    action: string[];\n};\nexport declare const DEFAULT_KEYS: KeyMap;\nexport declare const GLYPH: {\n    stick: string;\n    button: string;\n    tap: string;\n};\nexport declare function keyName(code: string): string;\nexport declare const escapeHtml: (s: string) => string;\nexport type Hint = {\n    html: string;\n    text: string;\n};\nexport declare function moveHint(device: Device, keys?: KeyMap): Hint;\nexport declare function actionHint(device: Device, name: string, keys?: KeyMap): Hint;"
        },
        {
          "file": "latch.ts",
          "declarations": "export type Latch = {\n    press(): void;\n    take(held: boolean): boolean;\n    clear(): void;\n    readonly latched: boolean;\n};\nexport declare function createLatch(): Latch;\nexport declare function edge(now: number, was: number, bit?: number): boolean;"
        },
        {
          "file": "lockstep.ts",
          "declarations": "import { type SeatInput } from './wire';\nexport type SeatReader<S> = (seat: number, tick: number, state: Readonly<S>, out: SeatInput) => void;\nexport type LockstepOptions<S> = {\n    state: S;\n    seats: number;\n    step(state: S, inputs: readonly Readonly<SeatInput>[], tick: number): void;\n    read: SeatReader<S>;\n    hz?: number;\n    maxSteps?: number;\n    history?: number;\n    snapshotEvery?: number;\n    clone?(state: S): S;\n    onTick?(tick: number, inputs: readonly Readonly<SeatInput>[], state: S): void;\n    tick?: number;\n};\nexport type Replay<S> = {\n    readonly state: S;\n    readonly tick: number;\n    readonly from: number;\n    readonly to: number;\n    readonly done: boolean;\n    readonly inputs: readonly Readonly<SeatInput>[];\n    step(): boolean;\n    frame(ms: number, speed?: number): {\n        steps: number;\n        alpha: number;\n    };\n    seek(tick: number): void;\n};\nexport type Lockstep<S> = {\n    readonly state: S;\n    readonly tick: number;\n    readonly hz: number;\n    readonly paused: boolean;\n    frame(ms: number): {\n        steps: number;\n        alpha: number;\n    };\n    stepOnce(): void;\n    pause(): void;\n    resume(): void;\n    readonly recorded: {\n        from: number;\n        to: number;\n    };\n    inputsAt(tick: number, out?: SeatInput[]): SeatInput[] | null;\n    replay(seconds?: number): Replay<S>;\n    reset(state: S, tick?: number): void;\n};\nexport declare function createLockstep<S>(o: LockstepOptions<S>): Lockstep<S>;"
        },
        {
          "file": "play-input.ts",
          "declarations": "import { type Device, type Hint, type KeyMap } from './hints';\nimport { type StickState } from './stick';\nimport type { SeatInput } from './wire';\nexport type { Device, KeyMap } from './hints';\ntype Pt = {\n    x: number;\n    y: number;\n};\nexport type PlayInputOptions = {\n    keys?: KeyMap;\n    keyTarget?: Window | HTMLElement;\n    touch?: boolean;\n    mouseAsTouch?: boolean;\n    gamepad?: number | 'any' | false;\n    reach?: number;\n    deadzone?: number;\n    action?: string;\n    button?: HTMLButtonElement | null;\n    ghost?: boolean;\n    ghostMs?: number;\n    ignore?(target: Element): boolean;\n    initial?: Device;\n    onDevice?(device: Device): void;\n    onPress?(device: Device): void;\n    onPinch?(a0: Pt, b0: Pt, a1: Pt, b1: Pt): void;\n};\nexport type PlayInput = {\n    readonly device: Device;\n    readonly stick: Readonly<StickState>;\n    readonly moved: number;\n    enabled: boolean;\n    poll(): void;\n    sample(out?: SeatInput): SeatInput;\n    press(device?: Device): void;\n    drop(): void;\n    drive(input: SeatInput | null): void;\n    setAction(label: string, ready?: number): void;\n    hints(): {\n        move: Hint;\n        action: Hint;\n    };\n    readonly button: HTMLButtonElement | null;\n    dispose(): void;\n};\nexport declare function createPlayInput(root: HTMLElement, o?: PlayInputOptions): PlayInput;"
        },
        {
          "file": "practice.ts",
          "declarations": "export type PracticeState = {\n    tried: boolean[];\n    ticks: number;\n    min: number;\n    max: number;\n};\nexport declare function createPractice(seats: number, min: number, max: number): PracticeState;\nexport declare function markTried(p: PracticeState, seat: number): boolean;\nexport declare const triedCount: (p: PracticeState) => number;\nexport declare function stepPractice(p: PracticeState): 'running' | 'done';\nexport declare function practiceLine(p: PracticeState): string;"
        },
        {
          "file": "rng.ts",
          "declarations": "export type Rng = {\n    s: number;\n};\nexport declare const createRng: (seed: number) => Rng;\nexport declare function next(r: Rng): number;\nexport declare const nextInt: (r: Rng, n: number) => number;\nexport declare const mix: (a: number, b: number) => number;"
        },
        {
          "file": "vote.ts",
          "declarations": "export type Pad = {\n    x: number;\n    y: number;\n    r: number;\n};\nexport type VoteState = {\n    on: number[];\n    counts: number[];\n    left: number;\n    full: boolean;\n};\nexport type VoteEvent = {\n    seat: number;\n    pad: number;\n    was: number;\n};\nexport type VoteResult = {\n    counts: number[];\n    winner: number;\n    tied: number[];\n};\nexport declare function padUnder(x: number, y: number, pads: readonly Pad[]): number;\nexport declare function createVote(seats: number, pads: number, ticks: number): VoteState;\nexport declare function stepVote(v: VoteState, positions: readonly {\n    x: number;\n    y: number;\n}[], pads: readonly Pad[], fullTicks: number): VoteEvent[];\nexport declare function closeVote(v: VoteState, r?: number): VoteResult;"
        },
        {
          "file": "wire.ts",
          "declarations": "export type SeatInput = {\n    mx: number;\n    my: number;\n    b: number;\n};\nexport declare const ACTION = 1;\nexport declare const NO_INPUT: Readonly<SeatInput>;\nexport declare const BYTES_PER_SEAT = 3;\nexport declare const blankInputs: (seats: number) => SeatInput[];\nexport declare function shape(x: number, y: number, gain?: number): [\n    number,\n    number\n];\nexport declare function quantise(x: number, y: number, b: number, out?: SeatInput, gain?: number): SeatInput;\nexport declare function direction(input: Readonly<SeatInput>): [\n    number,\n    number\n];\nexport declare const sameInput: (a: Readonly<SeatInput>, b: Readonly<SeatInput>) => boolean;\nexport declare function encode(inputs: readonly Readonly<SeatInput>[], into?: Uint8Array, offset?: number): Uint8Array;\nexport declare function decode(bytes: Uint8Array, seats: number, out?: SeatInput[], offset?: number): SeatInput[];"
        }
      ],
      "pitfalls": [
        "Sample each seat exactly once a tick (sample() clears the latch)",
        "A press is latched, not counted",
        "Keys are read on keyTarget, window by default",
        "The touch stick reads touch events where the browser has them",
        "Determinism is yours to keep in step()",
        "Bots must keep their memory and random numbers outside the game state",
        "The state must be plain data that structuredClone copies (the default clone)",
        "frame(ms) runs at most four ticks and drops the rest, so a stall never snowballs",
        "The field camera works in the element’s own px",
        "Two fingers count as a pinch only if the second lands within 300 ms of the first and before the…",
        "Gamepads have no events: call poll() once a frame, even while the input is disabled",
        "Disable the input (enabled = false) while the game is paused, as during a replay",
        "Anything floating over the field"
      ],
      "card": "entries/play-input.json"
    },
    {
      "id": "pose-tiers",
      "aliases": [],
      "name": "Pose-rate tiers for crowds",
      "summary": "Keep crowd simulation running while posing less important bodies every third or twelfth tick. Rank by distance with immediate promotion, demotion slack and a forced-full override; optionally slow small figures further. PosedRoot skips a second matrix walk after a published pose and transports unchanged joints rigidly between poses. A walking crowd compares live pose CPU with tiers on and off.",
      "category": "technique",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "calm",
      "tags": [
        "crowd",
        "pose rate",
        "animation",
        "level of detail",
        "CPU budget",
        "hysteresis",
        "fixed timestep",
        "matrix world",
        "skinning",
        "three.js",
        "webgpu",
        "webgl"
      ],
      "useCases": [
        "crowds whose live rig solve dominates CPU time",
        "far or small figures that can hold their last pose while movement stays correct",
        "keeping a selected or interacting figure at full pose rate",
        "avoiding duplicate matrix composition after a rig publishes its world matrices"
      ],
      "interaction": "Drag to rank · compare pose rates",
      "kits": [],
      "pairsWith": [
        {
          "id": "humanoid-rig",
          "why": "Keep its motor and gait ticking; gate only expensive pose sampling and rig application"
        },
        {
          "id": "crowd-bake",
          "why": "Use rate-limited live rigs where interaction matters; use baked GPU clips for the far background"
        },
        {
          "id": "capability-tiers",
          "why": "Choose application-specific full/posed budgets by device capability"
        }
      ],
      "variants": [],
      "version": "1.0.2",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "32 jointed figures in each comparison population",
          "low": "24 jointed figures in each comparison population"
        },
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 0.514,
          "cpuMs": 1.015,
          "cpuP95Ms": 2.53,
          "badge": "moderate",
          "drawCalls": 627,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 6.03,
            "p99Ms": 11.395,
            "low1Fps": 73.6
          },
          "notes": "Two identical populations of 48/32/24 simple jointed figures (high/medium/low), one visible: both simulate every fixed 60 Hz tick, but one poses at staggered 1/3/12 periods. Live CPU samples time pose dispatch and world-matrix publication only, averaged over 120 ticks; simulation, ranking, rigid transport and rendering are excluded. The hidden reference population adds real CPU work. No source-game timing is used as this demo’s cost."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "intel xe-2lpg",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Microsoft Edge 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 1.114,
          "cpuMs": 2.605,
          "cpuP95Ms": 3.715,
          "badge": "heavy",
          "drawCalls": 599,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Microsoft Edge 157, Chromium 157 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 550 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 4.74,
          "cpuMs": 1.16,
          "cpuP95Ms": 3,
          "badge": "heavy",
          "drawCalls": 599,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 369 ms."
        }
      ],
      "signatures": [
        {
          "file": "posed-root.ts",
          "declarations": "import { Group } from 'three';\nexport declare class PosedRoot extends Group {\n    rigid: boolean;\n    published: boolean;\n    parked: boolean;\n    track(): void;\n    updateMatrixWorld(force?: boolean): void;\n}"
        },
        {
          "file": "tiers.ts",
          "declarations": "export type ActorTier = 'full' | 'reduced' | 'distant';\nexport type PoseRates = Readonly<Record<ActorTier, number>>;\nexport declare const POSE_EVERY: PoseRates;\nexport declare const TIER_ORDER: readonly ActorTier[];\nexport type TierBudget = {\n    full: number;\n    posed: number;\n    slack: number;\n};\nexport type TierSubject = {\n    id: string;\n    x: number;\n    z: number;\n    forced: boolean;\n    tier: ActorTier;\n};\nexport declare function assignTiers(subjects: readonly TierSubject[], focus: {\n    x: number;\n    z: number;\n}, budget: TierBudget): Map<string, ActorTier>;\nexport declare const SMALL_ON_SCREEN = 60;\nexport declare const MID_ON_SCREEN = 130;\nexport type ScreenThresholds = {\n    small: number;\n    mid: number;\n};\nexport declare function sizeStretch(pixelsTall: number, thresholds?: Readonly<ScreenThresholds>): number;\nexport declare function posesOnTick(tick: number, tier: ActorTier, offset: number, stretch?: number, rates?: PoseRates): boolean;\nexport declare function crowdCostMs(counts: Record<ActorTier, number>, tickMs: number, poseMs: number, rates?: PoseRates): number;"
        }
      ],
      "pitfalls": [
        "Only posing is rationed: simulation, motor",
        "Caps are soft: posed includes full",
        "A held pose slides: a root keeps moving while its legs retain the last solve",
        "Publish after placement: published means every descendant world matrix already matches the…",
        "Own the subtree: set rigid only when descendant local transforms stay unchanged between poses",
        "Parked does not hide anything",
        "Pose tiers do not batch draws or stop skinning uploads",
        "Live samples are not costs.json"
      ],
      "card": "entries/pose-tiers.json"
    },
    {
      "id": "post-stack",
      "aliases": [],
      "name": "Post stack: AO, bloom, shine smoothing",
      "summary": "Ambient occlusion (GTAO from the frame’s own depth), bloom that only takes light brighter than lit white, specular anti-aliasing in every lit material and a colour grade, all riding on three’s own copy of the frame to the canvas: no scene pass, no MRT, nothing in the scene compiles again, and each pass can be held for an A/B switch without a compile.",
      "category": "post",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "balanced",
      "tags": [
        "ambient occlusion",
        "gtao",
        "bloom",
        "specular anti-aliasing",
        "shine flicker",
        "colour grading",
        "tone mapping",
        "tsl",
        "three.js",
        "webgpu",
        "three internals",
        "a/b compare",
        "post-processing"
      ],
      "useCases": [
        "contact shade where things meet, in any three.js WebGPU scene, without an extra scene pass",
        "glow round lamps, neon and sparks that never washes out lit white walls or snow",
        "stopping highlights flickering on bumpy, ridged or finely detailed glossy surfaces",
        "a graphics menu where each pass switches on and off without a hitch",
        "before/after comparisons of a look",
        "top-down and orthographic game views (the AO takes the camera axis)"
      ],
      "interaction": "Drag the handle to compare before and after · switch each pass in the card · Measure times them · drag to orbit",
      "kits": [
        {
          "kit": "game",
          "as": "core"
        },
        {
          "kit": "product-presentation",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "dynamic-resolution",
          "why": "Scale the passes with the picture"
        },
        {
          "id": "compile-without-stalls",
          "why": "Compile the post materials ahead"
        },
        {
          "id": "vehicle-showcase",
          "why": "A studio render that reads as a photo"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "Ambient occlusion at 0.75 of the resolution.",
          "low": "Ambient occlusion at half resolution, 2 slices of 4 steps (16 depth reads, not 24)."
        },
        "reducedMotion": false
      },
      "toneKnobs": [
        {
          "name": "bloom",
          "in": "demo",
          "values": {
            "strict": "off",
            "refined": "subtle",
            "playful": "strong"
          }
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 1.814,
          "cpuMs": 0.685,
          "cpuP95Ms": 1.065,
          "badge": "moderate",
          "drawCalls": 68,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 4.66,
            "p99Ms": 9.75,
            "low1Fps": 98
          },
          "notes": "The courtyard at 1× with all four passes on at their defaults (AO High at full resolution, bloom Subtle, shine smoothing High, the grade), the split off, the camera swaying so every frame is drawn. Standing still with nothing changing, nothing is drawn."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 15.663,
          "cpuMs": 1.895,
          "cpuP95Ms": 2.76,
          "badge": "heavy",
          "drawCalls": 68,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 1900 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 17.116,
          "cpuMs": 0.5,
          "cpuP95Ms": 1.38,
          "badge": "heavy",
          "drawCalls": 68,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 346 ms."
        }
      ],
      "signatures": [
        {
          "file": "colour-grade.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\ntype F = Node<'float'>;\ntype Live = F & {\n    value: number;\n};\nexport type ColourGrade = {\n    readonly saturation: Live;\n    readonly contrast: Live;\n    set(saturation: number, contrast: number): void;\n    uninstall(): void;\n};\nexport declare function installColourGrade(renderer: THREE.WebGPURenderer, options?: {\n    saturation?: number;\n    contrast?: number;\n    mask?: F;\n}): ColourGrade;\nexport {};"
        },
        {
          "file": "post-stack.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\nimport { ContactAoNode } from './ambient-occlusion';\nimport { GlowNode } from './bloom';\nimport { type AmbientOcclusion, type Bloom, type BloomLook, type PostTier } from './post-math';\nexport type PostStackOptions = {\n    mask?: Node<'float'>;\n    tier?: PostTier;\n};\nexport declare class PostStack {\n    readonly aoStrength: THREE.UniformNode<\"float\", number>;\n    aoOn: boolean;\n    bloomOn: boolean;\n    constructor(renderer: THREE.WebGPURenderer, scene: THREE.Scene, camera: THREE.Camera, options?: PostStackOptions);\n    setBloom(level: Bloom, look?: Partial<BloomLook>): boolean;\n    get bloomState(): {\n        level: Bloom;\n        on: boolean;\n        held: boolean;\n        blocked: string | null;\n        intensity: number;\n        threshold: number;\n        spread: number;\n        scale: number | null;\n        computed: number;\n    };\n    setAo(level: AmbientOcclusion, force?: boolean): boolean;\n    setAoLook(look: {\n        radius?: number;\n        strength?: number;\n    }): void;\n    get aoState(): {\n        level: AmbientOcclusion;\n        on: boolean;\n        held: boolean;\n        blocked: string | null;\n        scale: number | null;\n        slices: number | null;\n        steps: number | null;\n        radius: number | null;\n        strength: number;\n        computed: number;\n    };\n    render(): void;\n    unmark(): void;\n    unglow(): void;\n    composite(frame: THREE.Texture, ao: ContactAoNode | null, glow?: GlowNode | null): Node<\"vec4\">;\n    dispose(): void;\n}"
        },
        {
          "file": "shine-smoothing.ts",
          "declarations": "import type { Node } from 'three/webgpu';\nimport { type ShineSmoothing } from './post-math';\ntype F = Node<'float'>;\ntype V3 = Node<'vec3'>;\ntype Strength = F & {\n    value: number;\n};\nexport declare const shineRoughness: (rough: F, spread: F, strength: F) => F;\nexport declare function normalSpread(normal: V3): F;\nexport declare function smoothShine(rough: F, normal: V3, strength: F): F;\nexport type ShineSmoothingHandle = {\n    readonly strength: Strength;\n    setLevel(level: ShineSmoothing): void;\n    readonly value: number;\n    uninstall(): void;\n};\nexport declare function installShineSmoothing(options?: {\n    level?: ShineSmoothing;\n    mask?: F;\n}): ShineSmoothingHandle;\nexport declare function shineSmoothingInstalled(): boolean;\nexport {};"
        }
      ],
      "pitfalls": [
        "It reaches into three r187 internals",
        "It needs three’s frame buffer, which three makes when it tone-maps or converts colour space",
        "Draw with post.render(), not renderer.render(scene, camera)",
        "The AO spares transparents by draw order",
        "What glows is spared from the AO by brightness (linear max channel from 1 to 2, AO_GUARD)",
        "setAo and setBloom build their passes and a new copy",
        "The AO radius is in world units (metres in the source)",
        "The bloom threshold is linear brightness before exposure and the tone curve",
        "Shine smoothing patches three’s standard and physical material prototypes for the whole page",
        "Shine smoothing calms highlights from normals that turn within a pixel",
        "The grade is three’s CustomToneMapping on that renderer",
        "A mask is built into the copy and the materials",
        "On a weak GPU pass `tier` to the PostStack",
        "The glow is sized from the drawing buffer (three’s BloomNode) and the AO from the frame buffer"
      ],
      "card": "entries/post-stack.json"
    },
    {
      "id": "print-slicer",
      "aliases": [],
      "name": "Print slicer and motion planner",
      "summary": "A 3D printer’s slicer and motion planner, with the print drawn as it is laid. Any shape (a coverage mask) is sliced into layers: walls from a distance field’s level lines, a seam at the back, solid skin at ±45° top and bottom, gyroid or line infill, a skirt and a prime line, travels that retract and hop. Every move is then timed as firmware would: corner speeds by junction deviation, passes back and forward, a trapezoid of speeding up, cruising and slowing down. So any moment follows from the time alone: the nozzle traces the real path, a graph shows its speed, and the print scrubs both ways. Each laid line is ray-cast as an exact capsule on WebGPU, so the layer lines catch the light.",
      "category": "simulation",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "3d printing",
        "slicer",
        "toolpath",
        "motion planning",
        "trapezoid",
        "junction deviation",
        "gyroid",
        "distance field",
        "marching squares",
        "ray tracing",
        "capsules",
        "instancing",
        "shadow map",
        "scrubbable",
        "web worker",
        "wgsl",
        "raw webgpu"
      ],
      "useCases": [
        "a print or CNC preview: what a toolpath does, line by line, and how long it takes",
        "teaching acceleration: why a machine slows into corners, and why short moves never reach full speed",
        "timing any path that a head, pen, laser or robot follows (the planner works on its own)",
        "product and manufacturing visualisation, a hero animation of something being made",
        "a loading or splash moment that builds a logo or a shape layer by layer"
      ],
      "interaction": "Drag to turn, wheel or pinch to zoom · Space plays · PageUp/PageDown step a layer · scrub the bar",
      "kits": [],
      "pairsWith": [
        {
          "id": "laser-cutting",
          "why": "The same shapes cut instead of printed"
        },
        {
          "id": "transform-rig",
          "why": "Place and turn the part before slicing"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "Standard quality at 0.8× the pixels each way (still 4× multisampled).",
          "low": "Low quality: 0.75× the pixels, no multisampling, a 1,024 px shadow map."
        },
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 7.351,
          "cpuMs": 0.545,
          "cpuP95Ms": 0.82,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 20.343,
            "p99Ms": 31.3,
            "low1Fps": 31.7
          },
          "notes": "Measured printing the default gear at 32× time-lapse in a loop, from the front: the shadow map and the picture drawn every frame (every line in sight ray-cast as a capsule, 4× multisampling, standard quality), timed with its own timestamp queries. Planning runs in a worker and is not in the frame."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 18.842,
          "cpuMs": 0.745,
          "cpuP95Ms": 1.145,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 1089 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 8.248,
          "cpuMs": 1.04,
          "cpuP95Ms": 1.34,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 647 ms."
        }
      ],
      "signatures": [
        {
          "file": "motion.ts",
          "declarations": "import { type Steps } from './steps';\nexport declare const MOVE: {\n    readonly travel: 0;\n    readonly extrude: 1;\n    readonly z: 2;\n    readonly e: 3;\n    readonly dwell: 4;\n};\nexport declare const MOVE_FLOATS = 14;\nexport type Limits = {\n    v: number;\n    a: number;\n};\nexport declare class Moves {\n    x: number;\n    y: number;\n    z: number;\n    e: number;\n    readonly mv: number[];\n    readonly kinds: number[];\n    constructor(x?: number, y?: number, z?: number);\n    get count(): number;\n    travel(x: number, y: number, lim: Limits): void;\n    extrude(x: number, y: number, de: number, lim: Limits): boolean;\n    zTo(z: number): void;\n    feed(de: number): void;\n    dwell(secs: number, de: number): void;\n}\nexport type PlanOptions = {\n    deviation?: number;\n    zSpeed?: number;\n    zSettle?: number;\n    feedTime?: number;\n};\nexport type Motion = {\n    moves: Float64Array;\n    kinds: Uint8Array;\n    count: number;\n    total: number;\n    filament: number;\n};\nexport declare function trapezoid(L: number, v0: number, vp: number, v1: number, a: number): {\n    vp: number;\n    dur: number;\n};\nexport declare function planMotion(list: Moves, options?: PlanOptions): Motion;\nexport declare function planMotionSteps(list: Moves, { deviation, zSpeed, zSettle, feedTime }?: PlanOptions): Steps<Motion>;\nexport declare function along(L: number, dur: number, v0: number, vp: number, v1: number, a: number, tau: number): number;\nexport declare const PHASE: {\n    readonly still: 0;\n    readonly accelerate: 1;\n    readonly cruise: 2;\n    readonly decelerate: 3;\n};\nexport declare const PHASE_NAME: readonly [\n    \"still\",\n    \"speeding up\",\n    \"cruising\",\n    \"slowing down\"\n];\nexport declare function speedAlong(dur: number, v0: number, vp: number, v1: number, a: number, tau: number): {\n    speed: number;\n    phase: number;\n};\nexport declare function moveAt(motion: Pick<Motion, 'moves' | 'count'>, p: number): number;\nexport type Nozzle = {\n    x: number;\n    y: number;\n    z: number;\n    e: number;\n    vx: number;\n    vy: number;\n    speed: number;\n    phase: number;\n    extruding: boolean;\n    dwell: number;\n    move: number;\n    kind: number;\n};\nexport declare function nozzleAt(motion: Pick<Motion, 'moves' | 'kinds' | 'count'>, p: number, rest?: [\n    number,\n    number,\n    number\n]): Nozzle;\nexport type Profile = {\n    speed: Float32Array;\n    phase: Uint8Array;\n    kind: Uint8Array;\n    p0: number;\n    p1: number;\n};\nexport declare function speedProfile(motion: Pick<Motion, 'moves' | 'kinds' | 'count'>, p0: number, p1: number, n: number, out?: Profile): Profile;\nexport declare function topSpeed(motion: Pick<Motion, 'moves' | 'kinds' | 'count'>): number;"
        },
        {
          "file": "planner.ts",
          "declarations": "import { type PrintPlan, type SliceOptions } from './slicer';\nimport { type ShapeId } from './shapes';\nimport type { Mask } from './outline';\nexport type Planner = {\n    plan(what: {\n        shape: ShapeId;\n    } | {\n        mask: Mask;\n    }, options: SliceOptions): Promise<PrintPlan | null>;\n    dispose(): void;\n};\nexport type PlannerOptions = {\n    worker?: boolean;\n    budget?: number;\n};\nexport declare function createPlanner(options?: PlannerOptions): Planner;"
        },
        {
          "file": "print-view.ts",
          "declarations": "import { type PrintPlan } from './slicer';\nexport type V3 = [\n    number,\n    number,\n    number\n];\nexport type Quality = 'low' | 'standard' | 'high';\nexport type PrintTier = 'high' | 'medium' | 'low';\nexport declare const PRINT_TIERS: Record<PrintTier, {\n    quality: Quality;\n    scale: number;\n}>;\nexport type PrintViewOptions = {\n    quality?: Quality;\n    tier?: PrintTier;\n    scale?: number;\n};\nexport declare const QUALITY: Record<Quality, {\n    scale: number;\n    dpr: number;\n    msaa: number;\n    shadow: number;\n}>;\nexport type Camera = {\n    eye: V3;\n    target: V3;\n    fov: number;\n};\nexport type ColourBy = 'filament' | 'kind' | 'speed';\nexport type Look = {\n    filament?: string;\n    silk?: number;\n    colourBy?: ColourBy;\n    rate?: number;\n    exposure?: number;\n};\nexport type PrintView = {\n    readonly device: GPUDevice;\n    setPlan(plan: PrintPlan): Promise<void>;\n    draw(p: number, camera: Camera, look?: Look): boolean;\n    setQuality(quality: Quality): Promise<void>;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare function basis(eye: V3, target: V3): {\n    right: V3;\n    up: V3;\n    fwd: V3;\n};\nexport declare function createPrintView(canvas: HTMLCanvasElement, plan: PrintPlan, options?: PrintViewOptions): Promise<PrintView | null>;"
        },
        {
          "file": "slicer.ts",
          "declarations": "import { type Motion, type Nozzle } from './motion';\nimport { type Loop, type Mask, type P2 } from './outline';\nimport { type SliceRun, type Steps } from './steps';\nexport declare const KIND: {\n    readonly outer: 0;\n    readonly inner: 1;\n    readonly infill: 2;\n    readonly skin: 3;\n    readonly purge: 4;\n    readonly skirt: 5;\n    readonly blob: 6;\n};\nexport declare const KIND_NAME: readonly [\n    \"outer wall\",\n    \"inner wall\",\n    \"infill\",\n    \"solid skin\",\n    \"prime line\",\n    \"skirt\",\n    \"prime blob\"\n];\nexport declare const SEG_FLOATS = 12;\nexport declare const LINE = 0.45;\nexport declare const ISLANDS_MAX = 64;\nexport type Island = {\n    outer: Loop;\n    holes: Loop[];\n    centre: P2;\n    box: [\n        number,\n        number,\n        number,\n        number\n    ];\n    area: number;\n};\nexport type SliceOptions = {\n    size?: number;\n    plate?: number;\n    layer?: number;\n    height?: number;\n    walls?: number;\n    infill?: 'gyroid' | 'lines';\n    density?: number;\n    speed?: number;\n    twist?: number;\n    tol?: number;\n    grid?: number;\n    deviation?: number;\n    depth?: number;\n};\nexport type PrintPlan = {\n    layerH: number;\n    layers: number;\n    walls: number;\n    height: number;\n    twist: number;\n    segs: Float32Array<ArrayBuffer>;\n    segCount: number;\n    order: Uint32Array<ArrayBuffer>;\n    kept: number;\n    depth: number;\n    motion: Motion;\n    segMove: Uint32Array;\n    total: number;\n    filament: number;\n    fastest: number;\n    islands: Island[];\n    centre: P2;\n    size: P2;\n    plate: number;\n    park: [\n        number,\n        number,\n        number\n    ];\n};\nexport declare function speeds(speed?: number): {\n    outer: {\n        v: number;\n        a: number;\n    };\n    inner: {\n        v: number;\n        a: number;\n    };\n    infill: {\n        v: number;\n        a: number;\n    };\n    skin: {\n        v: number;\n        a: number;\n    };\n    first: {\n        v: number;\n        a: number;\n    };\n    travel: {\n        v: number;\n        a: number;\n    };\n    purge: {\n        v: number;\n        a: number;\n    };\n};\nexport declare function planPrint(mask: Mask, o?: SliceOptions): PrintPlan;\nexport declare function planPrintAsync(mask: Mask, o?: SliceOptions, run?: SliceRun): Promise<PrintPlan | null>;\nexport declare function planPrintSteps(mask: Mask, o?: SliceOptions): Steps<PrintPlan>;\nexport declare function inSight(plan: Pick<PrintPlan, 'segs' | 'order' | 'kept' | 'segCount' | 'layerH' | 'depth'>, p: number): {\n    kept: number;\n    from: number;\n    count: number;\n};\nexport declare function segmentsBy(plan: Pick<PrintPlan, 'segs' | 'segCount'>, p: number): number;\nexport declare function laying(plan: Pick<PrintPlan, 'segs' | 'segCount'>, p: number, at: Nozzle): {\n    seg: number;\n    k: number;\n} | null;\nexport declare function headAt(plan: Pick<PrintPlan, 'motion' | 'park'>, p: number): Nozzle;\nexport declare function statusAt(plan: PrintPlan, p: number): {\n    layer: number;\n    kind: string;\n    head: Nozzle;\n    done: boolean;\n};"
        },
        {
          "file": "speed-graph.ts",
          "declarations": "import { type Profile } from './motion';\nexport type GraphColours = {\n    accelerate: string;\n    cruise: string;\n    decelerate: string;\n    grid: string;\n    text: string;\n    now: string;\n    font?: string;\n};\nexport declare function drawSpeedGraph(g: CanvasRenderingContext2D, profile: Profile, top: number, now: number, c: GraphColours, dpr?: number): void;"
        }
      ],
      "pitfalls": [
        "Plan once, draw often: planPrint() slices and times a few-centimetre part in about 0.3 to 1 s",
        "Never call planPrint() on a page’s main thread",
        "The view uploads a plan’s lines (several MB) 1 MB a task",
        "A 2D canvas redrawn every frame beside the WebGPU view",
        "Everything is a function of print time `p`",
        "The planner is the firmware kind, not a physics simulation",
        "Many tiny segments (a fine curve, a gyroid) are each a corner",
        "inSight() draws the outer walls and the last layer for good",
        "Each line writes frag_depth from its ray’s hit",
        "In the shadow map each line is its box, depth only, so hidden boxes are rejected early",
        "Above the nozzle, the toolhead fades to a ghost wherever the print lies behind it",
        "Outer walls below the top that face away from the eye are dropped in the vertex shader",
        "Without multisampling the edges are in or out (coverage under a half is discarded)",
        "On an integrated GPU pass tier",
        "The view needs WebGPU",
        "A shape is a coverage mask, white on black"
      ],
      "card": "entries/print-slicer.json"
    },
    {
      "id": "prism-light",
      "aliases": [],
      "name": "Prism light: charts made of split light",
      "summary": "Spectral 2D light transport in WebGPU compute: thousands of rays a frame, each of one colour, refract through convex glass whose index depends on wavelength (Snell, Schlick’s Fresnel split by coin toss, total internal reflection), are drawn as additive lines into a half-size HDR buffer and averaged until the picture converges, then it rests. A data spectrum (shares as bands) through a prism lands on a screen as a chart made of light, and DOM labels sit exactly where each band lands because a CPU twin traces the same rays. DOM cards are frosted glass slabs the beam bends through; the pointer can be a lens. Glass is the mock-up’s even chart glass or real glass (Schott’s Sellmeier data through Cauchy’s equation), light is a designed even rainbow or the CIE 1931 colours; a dark room adds light, daylight turns it into coloured shadows on paper. A CPU-traced 2D still where WebGPU is missing.",
      "category": "simulation",
      "role": "hero-visual",
      "stack": [
        "webgpu"
      ],
      "character": "expressive",
      "tags": [
        "optics",
        "light transport",
        "spectral",
        "dispersion",
        "refraction",
        "prism",
        "snell",
        "fresnel",
        "total internal reflection",
        "cauchy",
        "sellmeier",
        "cie 1931",
        "chart",
        "data spectrum",
        "dom + gpu",
        "labels on the light",
        "compute",
        "raw webgpu",
        "wgsl",
        "draw on demand",
        "timestamp queries",
        "no dependencies"
      ],
      "useCases": [
        "a share chart made of light (a spectrum whose bands are the shares)",
        "page cards as glass a beam bends through",
        "teaching refraction, dispersion and total internal reflection",
        "real glasses compared: crown, flint, dense flint",
        "a hero scene with light the visitor moves",
        "labels that follow a beam exactly"
      ],
      "interaction": "Drag the light · drag around the prism to turn it (arrow keys on both) · drag a glass card through the beam · click a band to isolate it",
      "kits": [],
      "pairsWith": [
        {
          "id": "chart-access",
          "why": "The values as a table"
        },
        {
          "id": "quiet-charts",
          "why": "Plain charts beside the light"
        },
        {
          "id": "thin-film",
          "why": "More spectral colour worked out the same way"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 2.524,
          "cpuMs": 0.295,
          "cpuP95Ms": 0.59,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 30.925,
            "p99Ms": 32.255,
            "low1Fps": 30.8
          },
          "notes": "The data spectrum through chart glass at 8,192 rays a frame (65,536 beam segments drawn into a half-size HDR buffer), the prism swinging slowly and a glass card swept through the beam, so it never rests; haze, dust and the frosted cards composed at full size; timed with its own timestamp queries. At rest it draws nothing."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 4.194,
          "cpuMs": 0.465,
          "cpuP95Ms": 0.71,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.712,
            "p99Ms": 17.855,
            "low1Fps": 55.7
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 433 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 10.432,
          "cpuMs": 0.57,
          "cpuP95Ms": 0.92,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 639 ms."
        }
      ],
      "signatures": [
        {
          "file": "layout.ts",
          "declarations": "import { type OpticShape, type Vec2 } from './spectrum';\nexport type TurnOptions = {\n    test?: (ends: Vec2[]) => boolean;\n    from?: number;\n    to?: number;\n    step?: number;\n    bounds?: [\n        number,\n        number,\n        number,\n        number\n    ];\n};\nexport declare function solveTurn(prism: OpticShape, lamp: Vec2, target: OpticShape, { test, from, to, step, bounds }?: TurnOptions): number | null;\nexport declare function lampFor(prism: Vec2, target: Vec2, n: number, dist: number): Vec2;\nexport type Landing = {\n    x: number;\n    y: number;\n    s: number;\n    on: boolean;\n    absorber: number | null;\n};\nexport declare function landings(shapes: OpticShape[], lamp: Vec2, angle: number, ss: number[], screen: number, bounds?: [\n    number,\n    number,\n    number,\n    number\n]): Landing[];\nexport type Placed = {\n    want: number;\n    at: number;\n};\nexport declare function declutter<T extends {\n    want: number;\n    at?: number;\n}>(items: T[], gap: number, lo: number, hi: number): Array<T & Placed>;"
        },
        {
          "file": "optics.ts",
          "declarations": "import { type ColourModel, type OpticShape } from './spectrum';\nexport type Emitter = {\n    x: number;\n    y: number;\n    angle?: number;\n    width?: number;\n    spread?: number;\n    power?: number;\n    maxLen?: number;\n    rays?: number;\n    spectrum?: number;\n    sLo?: number;\n    sHi?: number;\n    radial?: boolean;\n    cap?: number;\n    source?: number;\n    falloff?: number;\n};\nexport type Spectrum = {\n    bands: Array<{\n        s0: number;\n        s1: number;\n        weight?: number;\n    }>;\n};\nexport type OpticsLook = {\n    mode: 'dark' | 'light';\n    bg: string;\n    bg2: string;\n    haze: number;\n    dust: number;\n    glass: string;\n    glassA: number;\n    rim: string;\n    rimI: number;\n    prism: string;\n    prismI: number;\n    exposure: number;\n    hitGain: number;\n    lineWidth: number;\n    shadow: number;\n    glow: number;\n    contrast: number;\n    saturation: number;\n    vignette: number;\n    grain: number;\n};\nexport declare const LOOKS: Record<'room' | 'daylight', OpticsLook>;\nexport type OpticsFrame = {\n    shapes: OpticShape[];\n    emitters: Emitter[];\n    spectra?: Spectrum[];\n    time?: number;\n    moving?: boolean;\n    haze?: number;\n};\nexport type Optics = {\n    device: GPUDevice;\n    capacity: number;\n    setLook(look: OpticsLook): void;\n    setColour(model: ColourModel): void;\n    resize(width: number, height: number, dpr: number): void;\n    render(frame: OpticsFrame): boolean;\n    restart(): void;\n    gpuMs(): number | null;\n    readonly lost: boolean;\n    onLost: ((reason: string) => void) | null;\n    dispose(): void;\n};\nexport type OpticsOptions = {\n    capacity?: number;\n    settleFrames?: number;\n    follow?: number;\n    device?: GPUDevice;\n    onError?: (message: string) => void;\n};\nexport declare const linearOf: (h: string) => [\n    number,\n    number,\n    number\n];\nexport declare function createOptics(canvas: HTMLCanvasElement, { capacity: cap, settleFrames, follow, device: given, onError }?: OpticsOptions): Promise<Optics | null>;"
        },
        {
          "file": "spectrum.ts",
          "declarations": "export type RGB = [\n    number,\n    number,\n    number\n];\nexport type ColourModel = 'even' | 'cie';\nexport declare const RED_NM = 690;\nexport declare const VIOLET_NM = 410;\nexport declare const lambdaOf: (s: number) => number;\nexport declare const sOf: (nm: number) => number;\nexport declare const spectralRaw: (s: number, model?: ColourModel) => RGB;\nexport declare function whiteOf(model?: ColourModel): RGB;\nexport declare function spectral(s: number, model?: ColourModel): RGB;\nexport declare function cssOf(s: number, model?: ColourModel, boost?: number): string;\nexport type Band = {\n    s0: number;\n    s1: number;\n    mid: number;\n    share: number;\n};\nexport declare function bandsOf(shares: number[], gap?: number): Band[];\nexport type Glass = {\n    n0: number;\n    disp: number;\n    cauchy?: boolean;\n};\nexport declare const CHART_GLASS: Glass;\nexport type Sellmeier = {\n    B: [\n        number,\n        number,\n        number\n    ];\n    C: [\n        number,\n        number,\n        number\n    ];\n};\nexport declare const GLASSES: {\n    crown: {\n        name: string;\n        sellmeier: {\n            B: [\n                number,\n                number,\n                number\n            ];\n            C: [\n                number,\n                number,\n                number\n            ];\n        };\n    };\n    flint: {\n        name: string;\n        sellmeier: {\n            B: [\n                number,\n                number,\n                number\n            ];\n            C: [\n                number,\n                number,\n                number\n            ];\n        };\n    };\n    dense: {\n        name: string;\n        sellmeier: {\n            B: [\n                number,\n                number,\n                number\n            ];\n            C: [\n                number,\n                number,\n                number\n            ];\n        };\n    };\n};\nexport type GlassId = keyof typeof GLASSES;\nexport declare function sellmeier(g: Sellmeier, nm: number): number;\nexport declare const LINES: {\n    F: number;\n    d: number;\n    C: number;\n};\nexport declare function cauchyFit(g: Sellmeier, boost?: number): Glass;\nexport declare const abbe: (g: Sellmeier) => number;\nexport declare function indexAt(g: Glass, s: number): number;\nexport declare const minDeviation: (n: number) => number;\nexport type ShapeKind = 'tri' | 'rect' | 'circle';\nexport type OpticShape = Partial<Glass> & {\n    kind: ShapeKind;\n    x: number;\n    y: number;\n    rot?: number;\n    sx: number;\n    sy?: number;\n    radius?: number;\n    appear?: number;\n    absorb?: boolean;\n    draw?: 'prism' | 'panel' | 'screen' | 'none';\n    highlight?: number;\n    haze?: number;\n    reflect?: number;\n    off?: boolean;\n};\nexport type Vec2 = [\n    number,\n    number\n];\nexport declare function vertsOf(sh: OpticShape): Vec2[];\nexport type Crossing = {\n    tIn: number;\n    nIn: Vec2;\n    tOut: number;\n    nOut: Vec2;\n};\nexport declare function hitShape(sh: OpticShape, ox: number, oy: number, dx: number, dy: number): Crossing | null;\nexport declare function inside(sh: OpticShape, x: number, y: number): boolean;\nexport type TraceOptions = {\n    maxSeg?: number;\n    maxLen?: number;\n    bounds?: [\n        number,\n        number,\n        number,\n        number\n    ] | null;\n};\nexport type Trace = {\n    pts: Vec2[];\n    absorber: number | null;\n    dir: Vec2;\n};\nexport declare function traceRay(shapes: Array<OpticShape | undefined>, ox: number, oy: number, dx: number, dy: number, s: number, { maxSeg, maxLen, bounds }?: TraceOptions): Trace;"
        }
      ],
      "pitfalls": [
        "Per-ray brightness is power × 48 ÷ rays, so the picture is the same at any ray count",
        "A chart made of light needs chart glass",
        "Labels come from the CPU twin (traceRay, landings), never from reading the GPU back",
        "render() returns true once the average has converged and nothing moved",
        "The haze drifts with `time`",
        "A DOM card is glass only where the GPU draws it",
        "solveTurn prefers turns where every probe ray goes in, through and out of the prism once",
        "Rays are clipped at the canvas’s edge and land on its bottom as a pool of light",
        "Up to 40 shapes, 48 emitters, 8 spectra of 16 bands and the capacity in rays",
        "The output is the mock-up’s",
        "A WebGPU device can be lost (a driver reset, a sleeping laptop)",
        "The canvas is kept within the device’s largest texture (8192 px on most)"
      ],
      "card": "entries/prism-light.json"
    },
    {
      "id": "probe-lighting",
      "aliases": [],
      "name": "Bounced light indoors",
      "summary": "Light that comes in through a window, lands on the floor and bounces round the room, worked out on the GPU in a few frames instead of the half a minute three.js’s own probe bake takes. The building’s triangles are voxelized into solid/air bits; every probe of a grid round it casts 32 rays through the bits cell by cell, seeing the sky through doors and windows, sunlit walls (a second ray to the sun), lamps it can see and, from the last pass, the light already bounced; the result goes into three’s LightProbeGrid as L2 spherical harmonics, which every lit material then shades with. Inside the grid the hemisphere light is taken off, so rooms are as dark as their openings make them; outside nothing changes. A batch of probes a frame, two result sets so nothing flashes, a box moved re-baked from the last result, refining passes that turn the rays and average them in while nothing moves, and eyes that adjust to dim rooms.",
      "category": "surface",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "calm",
      "tags": [
        "global illumination",
        "bounced light",
        "indirect light",
        "light probes",
        "LightProbeGrid",
        "irradiance volume",
        "spherical harmonics",
        "voxelization",
        "ray marching",
        "DDA",
        "compute",
        "atomics",
        "storage texture",
        "interiors",
        "architecture",
        "sun",
        "lamps",
        "time of day",
        "eye adaptation",
        "TSL",
        "WebGPU",
        "three.js",
        "webgl fallback",
        "cpu bake",
        "no dependencies"
      ],
      "useCases": [
        "interiors in a game or walk-through that must be darker than the yard outside, lit through their doors and windows",
        "architectural and room-planner views where furniture moves and the light follows in a moment",
        "a building that changes in play: a wall knocked through, a door shut, a box pushed in front of a window",
        "time of day moving the sun round a room, re-lit as it goes",
        "lamps whose light bounces off the walls at night, without a light map bake",
        "replacing a probe bake that renders cube maps from every probe (seconds to minutes) with one that runs while the scene plays"
      ],
      "interaction": "Drag a box to move it: the light re-bakes as you go · drag elsewhere to orbit",
      "kits": [
        {
          "kit": "product-presentation",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "progressive-path-tracer",
          "why": "A path-traced reference for the same room"
        },
        {
          "id": "post-stack",
          "why": "Occlusion and a grade on the lit room"
        },
        {
          "id": "lamp-lights",
          "why": "Lamps inside the room"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 2.31,
          "cpuMs": 0.49,
          "cpuP95Ms": 0.76,
          "badge": "heavy",
          "drawCalls": 22,
          "computeDispatches": 1,
          "frames": {
            "clock": "paced",
            "p50Ms": 4.14,
            "p99Ms": 8.555,
            "low1Fps": 95.2
          },
          "notes": "Measured with the cube gliding round the room by itself and the grid re-baked as each bake ends (voxelize, then one pass from the last result over 5,460 probes, a quarter of them a frame, 32 rays each). The sun at 16:00 through a window and a door, shadows on."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 6.75,
          "cpuMs": 1.425,
          "cpuP95Ms": 2.625,
          "badge": "heavy",
          "drawCalls": 22,
          "computeDispatches": 1,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 1325 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 4.044,
          "cpuMs": 0.1,
          "cpuP95Ms": 0.2,
          "badge": "heavy",
          "drawCalls": 22,
          "computeDispatches": 1,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 1918 ms."
        }
      ],
      "signatures": [
        {
          "file": "probe-lighting.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { LightProbeGrid } from 'three/addons/lighting/LightProbeGrid.js';\nimport { type BakePasses } from './schedule';\nexport type BouncedLightOptions = {\n    probes?: THREE.Vector3Like;\n    voxels?: THREE.Vector3Like;\n    rays?: number;\n    reach?: number;\n    triangles?: number;\n    vertices?: number;\n    perFrame?: number;\n    maxLamps?: number;\n    passes?: BakePasses;\n    fade?: number;\n    cpu?: boolean;\n    cpuMs?: number;\n};\nexport declare function bakesOnGpu(renderer: THREE.WebGPURenderer): boolean;\nexport type BuildingSolids = {\n    geometries: THREE.BufferGeometry[];\n    at: THREE.Vector3Like;\n};\nexport type SkyLight = {\n    sky: THREE.Color;\n    ground: THREE.Color;\n    sun: THREE.Color;\n    toSun: THREE.Vector3;\n};\nexport type BounceLamp = {\n    id: string;\n    x: number;\n    y: number;\n    z: number;\n    color: THREE.Color;\n    range: number;\n    decay: number;\n    spot: {\n        x: number;\n        y: number;\n        z: number;\n        cosOuter: number;\n        cosInner: number;\n    } | null;\n};\nexport type BouncedStats = {\n    building: string | null;\n    pass: number;\n    passes: number;\n    probes: number;\n    busy: boolean;\n    voxelizing: boolean;\n    cold: boolean;\n    share: number;\n    lit: boolean;\n    voxelized: number;\n    settled: number;\n    relit: number;\n    refining: number;\n    refines: number;\n    triangles: number;\n    clipped: boolean;\n    lamps: number;\n};\nexport declare class BouncedLight {\n    readonly grid: LightProbeGrid;\n    readonly stats: BouncedStats;\n    readonly res: THREE.Vector3;\n    readonly vox: THREE.Vector3;\n    fadeSeconds: number;\n    constructor(scene: THREE.Scene, options?: BouncedLightOptions);\n    adopt(hemisphere: THREE.HemisphereLight): void;\n    warm(renderer: THREE.WebGPURenderer): Promise<void>;\n    setBudget(perFrame: number): void;\n    get budget(): number;\n    setLook(adapt: number, strength: number, renderer?: THREE.WebGPURenderer | null): void;\n    show(shown: boolean): void;\n    isFor(key: string | null, solids: BuildingSolids | null): boolean;\n    place(key: string | null, bounds: THREE.Box3 | null, solids: BuildingSolids | null): void;\n    rebake(): void;\n    light(light: SkyLight, lamps?: readonly BounceLamp[]): void;\n    step(renderer: THREE.WebGPURenderer): void;\n    sample(renderer: THREE.WebGPURenderer, at: THREE.Vector3Like, normal: THREE.Vector3Like): Promise<number[]>;\n    dispose(): void;\n}"
        },
        {
          "file": "schedule.ts",
          "declarations": "export type BakeAction = {\n    kind: 'idle';\n} | {\n    kind: 'voxelize';\n} | {\n    kind: 'light';\n    into: 0 | 1;\n    first: number;\n    count: number;\n    begins: {\n        bounce: boolean;\n        pass: number;\n        refine: number;\n    } | null;\n    ends: {\n        publish: boolean;\n        shown: boolean;\n        settled: boolean;\n        done: boolean;\n    } | null;\n};\nexport type BakeProgress = {\n    busy: boolean;\n    voxelizing: boolean;\n    pass: number;\n    passes: number;\n    share: number;\n    cold: boolean;\n    refining: number;\n    refines: number;\n};\nexport type BakePasses = {\n    fresh: number;\n    rebuilt: number;\n    refine?: number;\n};\nexport declare class BakeSchedule {\n    readonly probes: number;\n    perFrame: number;\n    latest: 0 | 1;\n    shown: 0 | 1;\n    lit: boolean;\n    readonly passes: Required<BakePasses>;\n    constructor(probes: number, perFrame: number, passes?: BakePasses);\n    fresh(): void;\n    restart(): void;\n    rebuilt(): void;\n    relight(): void;\n    clear(): void;\n    get busy(): boolean;\n    get refining(): boolean;\n    progress(): BakeProgress;\n    next(): BakeAction;\n}\nexport type Rgb = {\n    r: number;\n    g: number;\n    b: number;\n};\nexport type SkyLightLike = {\n    sky: Rgb;\n    ground: Rgb;\n    sun: Rgb;\n    toSun: {\n        x: number;\n        y: number;\n        z: number;\n    };\n};\nexport declare function drifted(now: SkyLightLike, was: SkyLightLike, sunDrift?: number, colourDrift?: number): boolean;\nexport declare function lampKey(lamps: readonly {\n    id: string;\n}[], most: number): string;\nexport type Box = {\n    min: {\n        x: number;\n        y: number;\n        z: number;\n    };\n    max: {\n        x: number;\n        y: number;\n        z: number;\n    };\n};\nexport declare function gridBounds(building: Box, layers: number, { margin, over, base }?: {\n    margin?: number | undefined;\n    over?: number | undefined;\n    base?: number | undefined;\n}): Box;"
        }
      ],
      "pitfalls": [
        "Without WebGPU, bake on the CPU (`cpu: !bakesOnGpu(renderer)`, decided before construction:…",
        "Create the BouncedLight and `adopt()` the hemisphere light before anything is compiled",
        "Never hide or add a light to switch it off, the sun at night included",
        "Call `warm()` and wait for it before the first bake",
        "A new solids object is the signal to re-voxelize",
        "Only solids block light",
        "Pick cells so the narrowest opening is at least two cells across",
        "32 rays a probe are noisy where a small bright patch",
        "The grid holds light that bounces off surfaces, not a lamp’s own light on them",
        "A ray that leaves the grid’s box sees the hemisphere’s sky or ground",
        "The view shaders sample the grid only inside its box",
        "Eye adaptation (`adapt`) lifts each probe darker than the open sky toward it in the publish…",
        "One grid per page lights one building at a time"
      ],
      "card": "entries/probe-lighting.json"
    },
    {
      "id": "procedural-planets",
      "aliases": [],
      "name": "Procedural planets from a seed",
      "summary": "A whole planet from one number: a seed picks the kind (temperate, ocean, desert, ice, lava, gas giant or barren moon), its palette, its axis, and how much sea, ice, cloud, air and ring it has. Each planet is one quad drawn as a real lit sphere: warped fractal continents with a coast worked out on the CPU so the share of sea is exact, mountains, ice caps by latitude, the sun’s glint on open water, clouds with their shadows, glowing lava cracks, gas bands with a storm, craters, an atmosphere rim warm at the terminator and a halo outside, and rings on the planet’s own plane, the far half behind and the near half in front, each shadowing the other. Raw WebGPU, three instanced draws for any number of planets, on demand; a Canvas 2D still where WebGPU is missing.",
      "category": "simulation",
      "role": "hero-visual",
      "stack": [
        "webgpu"
      ],
      "character": "expressive",
      "tags": [
        "planet",
        "procedural",
        "seed",
        "space",
        "terrain",
        "ocean",
        "atmosphere",
        "rings",
        "clouds",
        "gas giant",
        "craters",
        "lava",
        "fbm",
        "value noise",
        "pcg hash",
        "impostor",
        "raw webgpu",
        "wgsl",
        "canvas 2d fallback",
        "draw on demand",
        "timestamp queries",
        "no dependencies"
      ],
      "useCases": [
        "a world for each user, project or save file, the same every time from its id",
        "a planet picker or a galaxy map in a game menu",
        "a hero image or a loading screen that is never the same twice",
        "icons and avatars drawn from a seed, at any size",
        "teaching what makes a planet look the way it does: sea level, air, ice, rings"
      ],
      "interaction": "Drag the planet to turn and tip it (or arrow keys) · pick a nearby seed below · type a seed or roll one",
      "kits": [],
      "pairsWith": [
        {
          "id": "cinematic-lens",
          "why": "Bloom and a grade in space"
        },
        {
          "id": "arrival-shockwave",
          "why": "Arrive at the planet at lightspeed"
        },
        {
          "id": "earth-globe",
          "why": "A realistic Earth beside the made-up worlds"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 4.73,
          "cpuMs": 0.22,
          "cpuP95Ms": 0.375,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.84,
            "p99Ms": 18.055,
            "low1Fps": 55
          },
          "notes": "Measured with the hero turning (body, rings and halo) and six small planets beside it, all in one canvas with three instanced draws, timed by their own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.114,
          "cpuMs": 0.355,
          "cpuP95Ms": 0.58,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 1783 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 16.271,
          "cpuMs": 0.04,
          "cpuP95Ms": 0.2,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 283 ms."
        }
      ],
      "signatures": [
        {
          "file": "noise.ts",
          "declarations": "export declare function pcg3(x: number, y: number, z: number): number;\nexport declare function rng(seed: number): {\n    next: () => number;\n    range: (a: number, b: number) => number;\n};\nexport declare function seedOf(text: string): number;\nexport declare function vnoise(x: number, y: number, z: number): number;\nexport declare function fbm(x: number, y: number, z: number, octaves: number): number;"
        },
        {
          "file": "planet-spec.ts",
          "declarations": "export type Rgb = [\n    number,\n    number,\n    number\n];\nexport type PlanetKind = 'terran' | 'ocean' | 'desert' | 'ice' | 'lava' | 'gas' | 'barren';\nexport declare const KINDS: PlanetKind[];\nexport declare const KIND_LABEL: Record<PlanetKind, string>;\nexport type Rings = {\n    inner: number;\n    outer: number;\n    density: number;\n    seed: number;\n};\nexport type PlanetSpec = {\n    seed: number;\n    kind: PlanetKind;\n    sea: number;\n    seaLevel: number;\n    relief: number;\n    scale: number;\n    warp: number;\n    ice: number;\n    clouds: number;\n    atmosphere: number;\n    glow: number;\n    bands: number;\n    storm: [\n        number,\n        number,\n        number\n    ];\n    roll: number;\n    lean: number;\n    day: number;\n    rings: Rings | null;\n    offset: [\n        number,\n        number,\n        number\n    ];\n    colours: {\n        deep: Rgb;\n        shallow: Rgb;\n        low: Rgb;\n        high: Rgb;\n        peak: Rgb;\n        air: Rgb;\n        ring: Rgb;\n        accent: Rgb;\n    };\n};\nexport type Overrides = Partial<Pick<PlanetSpec, 'kind' | 'sea' | 'clouds' | 'atmosphere' | 'relief'>> & {\n    rings?: 'auto' | 'on' | 'off';\n};\nexport declare function hsl(h: number, s: number, l: number): Rgb;\nexport declare function planetFromSeed(seed: number, over?: Overrides): PlanetSpec;\nexport declare function terrainAt(spec: Pick<PlanetSpec, 'scale' | 'warp' | 'relief' | 'offset'>, x: number, y: number, z: number): number;\nexport declare function sphereSamples(n: number): Array<[\n    number,\n    number,\n    number\n]>;\nexport declare function seaLevelFor(spec: Pick<PlanetSpec, 'scale' | 'warp' | 'relief' | 'offset'>, share: number, samples?: number): number;\nexport type PlanetFacts = {\n    name: string;\n    kind: string;\n    rows: Array<[\n        string,\n        string\n    ]>;\n};\nexport declare function planetFacts(spec: PlanetSpec): PlanetFacts;\nexport declare const PLANET_FLOATS = 64;\nexport type PlanetView = {\n    spec: PlanetSpec;\n    x: number;\n    y: number;\n    radius: number;\n    spin: number;\n    cloudSpin?: number;\n};\nexport declare function packPlanet(out: Float32Array, at: number, v: PlanetView): void;"
        },
        {
          "file": "planets.ts",
          "declarations": "import { type PlanetView } from './planet-spec';\nexport type PlanetFrame = {\n    time: number;\n    light: [\n        number,\n        number,\n        number\n    ];\n    ambient?: number;\n    motion?: number;\n};\nexport type PlanetRenderer = {\n    draw(planets: PlanetView[], frame: PlanetFrame): boolean;\n    detail: number;\n    pixelRatio: number;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare function createPlanetRenderer(canvas: HTMLCanvasElement, { capacity, detail, onLost }?: {\n    capacity?: number;\n    detail?: number;\n    onLost?: (reason: string) => void;\n}): Promise<PlanetRenderer | null>;"
        },
        {
          "file": "still.ts",
          "declarations": "import { type PlanetSpec } from './planet-spec';\nexport declare function paintPlanet(ctx: CanvasRenderingContext2D, spec: PlanetSpec, cx: number, cy: number, radius: number, { spin, light }?: {\n    spin?: number | undefined;\n    light?: [\n        number,\n        number,\n        number\n    ] | undefined;\n}): void;"
        }
      ],
      "pitfalls": [
        "The coast is a quantile, not a constant",
        "The continents use fixed octaves on both sides (5 for the base, 4 for the ridges)",
        "dpdx and dpdy need uniform control flow in WGSL",
        "A ring point that falls on the disc is in front of the body when its depth is positive",
        "Keep lean (the axis tipped toward you) away from zero",
        "The noise lattice is offset by the seed (up to about 1,000 cells)",
        "The hash takes integer lattice points through bitcast<vec3u>(vec3i(floor(p))) in WGSL and…",
        "The canvas is not sRGB: colours are kept linear in the spec and encoded at the end of the shader",
        "draw() returns false while the last frame is still on the GPU",
        "A device can be lost while the page is open (a driver reset, a laptop waking)",
        "seedOf() reads any u32 written in digits (up to 4294967295) as that number",
        "The Canvas 2D still costs about 40 ms for a 120 px radius (all on the main thread)"
      ],
      "card": "entries/procedural-planets.json"
    },
    {
      "id": "progressive-path-tracer",
      "aliases": [],
      "name": "Progressive path tracer with a sun slider",
      "summary": "A WebGPU compute path tracer for rooms and buildings made of boxes and ellipsoids, lit by the real sun for any day, hour and latitude, a sky and lamps. Every frame adds samples to one running average; an edge-aware à-trous denoiser makes it look settled in about 0.3 s (16 samples), fades out as samples arrive, and then the GPU rests. A moved sun dissolves in without a flash; once settled it bakes the bounced light for a handful of sun times, so dragging the sun shows live sunlight on baked light. Reprojection for camera moves, a lit page section whose headings cast shadows, CPU ray casts for the plain numbers and a line-drawing fallback.",
      "category": "surface",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "calm",
      "tags": [
        "path tracing",
        "progressive rendering",
        "accumulation",
        "denoiser",
        "a-trous",
        "svgf",
        "sun position",
        "daylight",
        "interior",
        "architecture",
        "pbr",
        "ggx",
        "next-event estimation",
        "low discrepancy",
        "reprojection",
        "baked light",
        "lit wall",
        "text shadows",
        "compute",
        "raw webgpu",
        "wgsl",
        "rest when still",
        "timestamp queries",
        "no dependencies"
      ],
      "useCases": [
        "a room or a building lit by the real sun for any day and hour",
        "a hero render that settles and then costs nothing",
        "daylight studies: where the sun falls and for how long",
        "a material or finish shown under true light",
        "a page section lit like a wall, its headings casting shadows",
        "a still that refines while the visitor reads"
      ],
      "interaction": "Drag the picture sideways or the sun along its arc (arrow keys too) · pick a view · watch the samples, then the rest",
      "kits": [
        {
          "kit": "product-presentation",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "probe-lighting",
          "why": "Real-time bounce light for the same room"
        },
        {
          "id": "physical-sky",
          "why": "The sky behind the sun it traces"
        },
        {
          "id": "site-plan",
          "why": "The plan of the building it renders"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 4.543,
          "cpuMs": 0.14,
          "cpuP95Ms": 0.445,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.2,
            "p99Ms": 30.72,
            "low1Fps": 31.7
          },
          "notes": "Measured exercising itself: once the light has settled and the sun times are baked, the sun sweeps back and forth across the day every 12 s, so every frame shows live direct sun on baked light (a shadow ray a pixel, the composite and the denoiser) at render scale 0.6 of the stage. Settling after a change costs 4–6 ms a frame for a few seconds; resting costs nothing."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 8.061,
          "cpuMs": 0.165,
          "cpuP95Ms": 0.28,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 2359 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 8.319,
          "cpuMs": 0.24,
          "cpuP95Ms": 0.74,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 783 ms."
        }
      ],
      "signatures": [
        {
          "file": "accum.ts",
          "declarations": "export type AccumTarget = {\n    readonly canvas: HTMLCanvasElement;\n    scale: number;\n    w: number;\n    h: number;\n    cssWidth: number;\n    cssHeight: number;\n    buf: GPUBuffer;\n    aux: GPUBuffer;\n    version: number;\n    resize(): boolean;\n    destroy(): void;\n};\nexport type ShowOptions = {\n    exposure?: number;\n    strength?: number;\n    mode?: number;\n    lift?: number;\n    saturation?: number;\n    stride?: number;\n    mask?: number;\n};\nexport type AccumKit = {\n    readonly device: GPUDevice;\n    target(canvas: HTMLCanvasElement, options?: {\n        scale?: number;\n        maxPixels?: number;\n    }): AccumTarget;\n    denoise(enc: GPUCommandEncoder, t: AccumTarget): void;\n    show(enc: GPUCommandEncoder, t: AccumTarget, options?: ShowOptions): void;\n    dispose(): void;\n};\nexport declare function createAccumKit(device: GPUDevice, format: GPUTextureFormat): Promise<AccumKit>;"
        },
        {
          "file": "budget.ts",
          "declarations": "export type BudgetOptions = {\n    start?: number;\n    min?: number;\n    max?: number;\n    busyMax?: number;\n    slowMs?: number;\n    fastMs?: number;\n};\nexport declare class SampleBudget {\n    value: number;\n    readonly min: number;\n    readonly max: number;\n    readonly busyMax: number;\n    readonly slowMs: number;\n    readonly fastMs: number;\n    constructor({ start, min, max, busyMax, slowMs, fastMs }?: BudgetOptions);\n    frame(busy: boolean): number;\n    adapt(ms: number): void;\n}\nexport declare function samplesFor(pixels: number, room: number, big?: boolean): {\n    spp: number;\n    full: boolean;\n};"
        },
        {
          "file": "light-wall.ts",
          "declarations": "import type { AccumKit, AccumTarget } from './accum';\nimport type { Vec3 } from './sun';\nexport type WallLight = {\n    soft: number;\n    sunCone: number;\n    sun: Vec3;\n    sunE: Vec3;\n    windowZ: number;\n    rects: Array<[\n        number,\n        number,\n        number,\n        number\n    ]>;\n    sky: Vec3;\n    amb: Vec3;\n    alb: Vec3;\n    standoff: [\n        number,\n        number\n    ];\n    lamp: [\n        number,\n        number,\n        number,\n        number\n    ];\n    lampE: Vec3;\n    exposure: number;\n};\nexport type LitWall = {\n    readonly target: AccumTarget;\n    readonly samples: number;\n    goal: number;\n    active: boolean;\n    readonly light: Readonly<WallLight>;\n    soften(k?: number): void;\n    set(light: Partial<WallLight>, k?: number): boolean;\n    setText(host: HTMLElement, items: Array<{\n        el: Element;\n        channel: 0 | 1;\n    }>): void;\n    needs(): boolean;\n    pixels(): number;\n    encode(enc: GPUCommandEncoder, spp?: number): number;\n    dispose(): void;\n};\nexport type LightWalls = {\n    wall(canvas: HTMLCanvasElement, options?: {\n        scale?: number;\n        target?: number;\n        softCap?: number;\n        maskScale?: number;\n    }): LitWall;\n    dispose(): void;\n};\nexport declare function createLightWall(device: GPUDevice, kit: AccumKit): Promise<LightWalls>;\nexport declare function linear(hex: string): Vec3;"
        },
        {
          "file": "path-tracer.ts",
          "declarations": "import type { AccumKit, AccumTarget } from './accum';\nimport type { BuiltScene } from './scene';\nimport type { Sky, Vec3 } from './sun';\nexport declare const LIMITS: {\n    readonly prims: 320;\n    readonly groups: 40;\n    readonly lamps: 8;\n};\nexport type CameraSpec = {\n    eye: Vec3;\n    look: Vec3;\n    fov?: number;\n    ortho?: number;\n    level?: number | boolean;\n    shift?: number;\n};\nexport type ViewOptions = {\n    facade: number;\n    clay: number;\n    ground: number;\n    haze: number;\n    cut: [\n        number,\n        number,\n        number,\n        number\n    ];\n    bounces: number;\n    exposure: number;\n    lampE: Vec3;\n    clamp: number;\n    lift: number;\n    saturation: number;\n    denoise: boolean;\n    restDenoise: number;\n    litDenoise: number;\n};\nexport type BakeSpec = {\n    hours: number[];\n    skyAt(hour: number): Sky;\n    lampsAt(hour: number): Vec3;\n    samples?: number;\n};\nexport type PathView = {\n    readonly target: AccumTarget;\n    readonly samples: number;\n    goal: number;\n    active: boolean;\n    bakeWanted: boolean;\n    readonly options: Readonly<ViewOptions>;\n    soften(k?: number): void;\n    setScene(scene: BuiltScene, k?: number): void;\n    setCamera(cam: CameraSpec, k?: number): void;\n    setSky(sky: Sky, k?: number, hour?: number | null): void;\n    set(options: Partial<ViewOptions>, k?: number): boolean;\n    lit(): boolean;\n    needs(): boolean;\n    pixels(full?: boolean): number;\n    project(p: Vec3, size?: {\n        width: number;\n        height: number;\n    }): {\n        x: number;\n        y: number;\n    } | null;\n    encode(enc: GPUCommandEncoder, options?: {\n        spp?: number;\n        full?: boolean;\n    }): number;\n    enableBake(spec: BakeSpec): void;\n    disableBake(): void;\n    bakeReady(hour: number): boolean;\n    bakePending(): boolean;\n    bakeStep(enc: GPUCommandEncoder, budget: number): number;\n    bakeProgress(): number;\n    dispose(): void;\n};\nexport type PathTracer = {\n    view(canvas: HTMLCanvasElement, options?: {\n        scale?: number;\n        target?: number;\n        softCap?: number;\n        stride?: number;\n        reproject?: boolean;\n        sunDegrees?: number;\n    }): PathView;\n    dispose(): void;\n};\nexport declare function createPathTracer(device: GPUDevice, kit: AccumKit): Promise<PathTracer>;"
        },
        {
          "file": "scene.ts",
          "declarations": "import type { Vec3 } from './sun';\nexport declare const MAT: {\n    readonly GROUND: 0;\n    readonly CONCRETE: 1;\n    readonly CHAR: 2;\n    readonly TRAV: 3;\n    readonly CORTEN: 4;\n    readonly GLASS: 5;\n    readonly PLASTER: 6;\n    readonly OAK: 7;\n    readonly STEEL: 8;\n    readonly WATER: 9;\n    readonly LEAF: 10;\n    readonly BARK: 11;\n    readonly LAMP: 12;\n    readonly FACADE: 13;\n    readonly FABRIC: 14;\n    readonly GRANITE: 15;\n    readonly PAPER: 16;\n};\nexport type MaterialId = (typeof MAT)[keyof typeof MAT];\nexport type Plane = [\n    number,\n    number,\n    number,\n    number\n];\nexport declare function plane(n: Vec3, d: number): Plane;\nexport type PrimOptions = {\n    planes?: Plane[];\n    cut?: boolean;\n    level?: number;\n    group?: string;\n    tag?: string;\n};\nexport type WallOptions = PrimOptions & {\n    glass?: boolean;\n};\nexport type LampOptions = {\n    level?: number;\n    group?: string;\n    tag?: string;\n    cut?: boolean;\n    e?: number;\n};\ntype Item = {\n    kind: 0 | 1;\n    lo: Vec3;\n    hi: Vec3;\n    mat: number;\n    planes: Plane[];\n    cut: boolean;\n    level: number;\n    group: string;\n    tag?: string;\n};\ntype LampItem = {\n    c: Vec3;\n    u: Vec3;\n    v: Vec3;\n    area: number;\n    level: number;\n    e: number;\n    tag: string;\n};\nexport type BuiltPrim = {\n    kind: 0 | 1;\n    lo: Vec3;\n    hi: Vec3;\n    mat: number;\n    planes: Plane[];\n};\nexport type BuiltScene = {\n    prims: Float32Array<ArrayBuffer>;\n    groups: Float32Array<ArrayBuffer>;\n    lamps: Float32Array<ArrayBuffer>;\n    nPrims: number;\n    nGroups: number;\n    nLamps: number;\n    list: BuiltPrim[];\n};\nexport declare class SceneBuilder {\n    items: Item[];\n    lamps: LampItem[];\n    box(x0: number, y0: number, z0: number, x1: number, y1: number, z1: number, mat: number, o?: PrimOptions): this;\n    ell(cx: number, cy: number, cz: number, rx: number, ry: number, rz: number, mat: number, o?: PrimOptions): this;\n    wallX(x0: number, x1: number, y0: number, y1: number, z0: number, z1: number, mat: number, openings?: number[][], o?: WallOptions): this;\n    wallZ(z0: number, z1: number, y0: number, y1: number, x0: number, x1: number, mat: number, openings?: number[][], o?: WallOptions): this;\n    pine(x: number, z: number, h: number, o?: {\n        tag?: string;\n        r?: number;\n    }): this;\n    crown(x: number, z: number, h: number, r: number, o?: {\n        tag?: string;\n        trunk?: number;\n    }): this;\n    lamp(c: Vec3, u: Vec3, v: Vec3, o?: LampOptions): this;\n    build({ explode, gap, skip, only }?: {\n        explode?: number | undefined;\n        gap?: number | undefined;\n        skip?: string[] | undefined;\n        only?: string[] | null | undefined;\n    }): BuiltScene;\n}\nexport declare function rayHits(scene: BuiltScene, o: Vec3, d: Vec3, tmax?: number): number;\nexport {};"
        },
        {
          "file": "sun.ts",
          "declarations": "export type Vec3 = [\n    number,\n    number,\n    number\n];\nexport type Sky = {\n    dir: Vec3;\n    sunE: Vec3;\n    zen: Vec3;\n    hor: Vec3;\n    haze: Vec3;\n    day: number;\n    up: number;\n};\nexport declare function declination(day: number): number;\nexport declare function solar(day: number, hour: number, latDeg: number): {\n    az: number;\n    el: number;\n};\nexport declare function dayLength(day: number, latDeg: number): number;\nexport declare function sunDir(az: number, el: number): Vec3;\nexport declare function skyFor(el: number, az: number): Sky;\nexport declare function skyAt(day: number, hour: number, latDeg: number): Sky & {\n    az: number;\n    el: number;\n};\nexport declare function bakeHours(day: number, latDeg: number, lo: number, hi: number, must?: number[]): number[];"
        }
      ],
      "pitfalls": [
        "It rests only when you let it. needs() is false once the samples reach the goal and the picture…",
        "Never reset with soften(0) for an ordinary change",
        "The bake is only used while you pass the hour",
        "Bake once the picture rests, not alongside it",
        "An interior is lit mostly by bounced light, which is exactly what the bake holds",
        "A view keeps 320 primitives, 40 groups and 8 lamps (LIMITS)",
        "Path-traced interiors are lit mostly by bounced light, which converges slowly",
        "The cost is per pixel-sample (about 20 ns for this room on the reference laptop)",
        "The accumulation buffers are sized from the canvas’s CSS box times the scale when the target is…",
        "Lamps light the scene only while their radiance (lampE) is above zero",
        "The lit wall’s mask is drawn from the DOM text where the browser laid it out",
        "Without WebGPU nothing here runs"
      ],
      "card": "entries/progressive-path-tracer.json"
    },
    {
      "id": "property-panel",
      "aliases": [],
      "name": "Property panel from a schema, in a dockable window",
      "summary": "An inspector built from a description of the settings: number (a slider and a box), toggle, choice (a list or buttons), colour (a swatch and any CSS colour), date, picture (chosen or dropped, kept small) and text fields, grouped, each with its hint, its own message in words and a draft that typing never fights; a catalog of kinds swaps in each kind’s own fields with its defaults. Behind it, built-in definitions with copies kept on this device: changed fields marked and reset one by one, revert, copy under a fresh id, checks that refuse a bad save, and export back to a source file. Around it, a floating window you drag by its title bar, resize, dock left, right or at the foot (or let go near a side), that becomes a sheet on a phone and remembers where it was. Plain DOM, no dependencies.",
      "category": "ui",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "property panel",
        "inspector",
        "schema",
        "form builder",
        "settings",
        "catalog",
        "defaults",
        "overrides",
        "revert",
        "export",
        "validation",
        "colour field",
        "date field",
        "image field",
        "draft",
        "floating window",
        "docking",
        "drag",
        "resize",
        "bottom sheet",
        "accessibility",
        "keyboard",
        "touch",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "inspectors in design tools and editors",
        "settings of a layer, an effect or a chart, described once",
        "presets that ship built in and can be changed, reverted or copied",
        "turning what someone made in an editor into a source file",
        "tool windows people move, dock and resize",
        "a panel that becomes a sheet on a phone"
      ],
      "interaction": "Pick a poster · change it in the properties: a dot marks what differs from built in · Save, Copy or Revert · drag the window’s title bar to a side to dock it · As a file shows the export",
      "kits": [],
      "pairsWith": [
        {
          "id": "colour-picker",
          "why": "Its colour fields"
        },
        {
          "id": "labelled-undo",
          "why": "One undo step per drag"
        },
        {
          "id": "split-panes",
          "why": "Docked in a pane of the editor"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": null,
          "cpuMs": 0.595,
          "cpuP95Ms": 0.91,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.54,
            "p99Ms": 18.055,
            "low1Fps": 54.8
          },
          "notes": "Measured exercising itself: each frame types a step into Title size and Corners through the panel (store, refresh, the poster redrawn), and every 40 frames another poster is opened (its fields rebuilt). Idle, nothing runs."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 1.018,
          "cpuP95Ms": 1.64,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 173 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.72,
          "cpuP95Ms": 0.96,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 161 ms."
        }
      ],
      "signatures": [
        {
          "file": "floatingWindow.ts",
          "declarations": "import { type Area, type Dock, type Place, type Size } from './place';\nexport type PlaceStorage = {\n    load(): unknown;\n    save(p: Place): void;\n};\nexport declare function localPlaceStorage(key: string): PlaceStorage;\nexport type FloatingWindowOptions = {\n    title: string;\n    label?: string;\n    content?: HTMLElement;\n    min?: Size;\n    initial?: (area: Area) => Place;\n    storage?: PlaceStorage | null;\n    insets?: () => {\n        top?: number;\n        left?: number;\n        right?: number;\n        bottom?: number;\n    };\n    tools?: HTMLElement[];\n    closable?: boolean;\n    folded?: boolean;\n    onClose?: () => void;\n    onPlace?: (place: Place, shown: Dock) => void;\n    headingLevel?: 2 | 3 | 4;\n};\nexport type FloatingWindow = {\n    readonly el: HTMLElement;\n    readonly body: HTMLElement;\n    readonly place: Place;\n    readonly shown: Dock;\n    readonly isOpen: boolean;\n    dock(side: Dock): void;\n    fold(on: boolean): void;\n    readonly folded: boolean;\n    setPlace(p: Place): void;\n    setTitle(title: string): void;\n    open(o?: {\n        focus?: boolean;\n    }): void;\n    close(): void;\n    refit(): void;\n    dispose(): void;\n};\ndeclare const ICONS: {\n    grip: string;\n    left: string;\n    float: string;\n    right: string;\n    bottom: string;\n    close: string;\n    fold: string;\n};\nexport declare function floatingWindow(host: HTMLElement, o: FloatingWindowOptions): FloatingWindow;\nexport { ICONS as WINDOW_ICONS };"
        },
        {
          "file": "overrides.ts",
          "declarations": "export type Definition = {\n    id: string;\n    name: string;\n};\nexport type OverrideStorage = {\n    load(): unknown;\n    save(list: unknown[]): boolean;\n};\nexport declare function memoryStorage(initial?: unknown[]): OverrideStorage & {\n    list: unknown[];\n};\nexport declare function localOverrideStorage(key: string): OverrideStorage;\nexport declare const ID_PATTERN: RegExp;\nexport declare function basicProblems(d: unknown): string[];\nexport declare function freshId(id: string, taken: readonly string[]): {\n    id: string;\n    n: number;\n};\nexport declare function copyOf<T extends Definition>(def: T, taken: readonly string[]): T;\nexport type FileShape = {\n    typeName: string;\n    typeFrom: string;\n    note?: (def: Definition) => string;\n};\nexport declare const exportName: (id: string, prefix?: string) => string;\nexport declare function asFile(def: Definition, shape: FileShape): string;\nexport type SaveResult = {\n    ok: true;\n    kept: boolean;\n} | {\n    ok: false;\n    problems: string[];\n};\nexport type OverrideStore<T extends Definition> = {\n    all(): T[];\n    get(id: string): T | undefined;\n    builtIn(id: string): T | undefined;\n    isBuiltIn(id: string): boolean;\n    isStored(id: string): boolean;\n    save(def: T): SaveResult;\n    revert(id: string): void;\n    copy(def: T): T;\n    problems(def: T): string[];\n    subscribe(listener: () => void): () => void;\n};\nexport type OverrideOptions<T extends Definition> = {\n    builtIns: readonly T[];\n    storage?: OverrideStorage;\n    problems?: (def: T) => string[];\n};\nexport declare function overrideStore<T extends Definition>(o: OverrideOptions<T>): OverrideStore<T>;"
        },
        {
          "file": "propertyPanel.ts",
          "declarations": "import { type Field, type ImageField, type Problem, type Values } from './schema';\nexport type PropertyPanelOptions = {\n    fields: readonly Field[] | ((values: Values) => readonly Field[]);\n    read: () => Values;\n    commit: (key: string, value: unknown) => void;\n    base?: () => Values | null;\n    defaults?: () => Values | null;\n    live?: boolean;\n    label?: string;\n    headingLevel?: 2 | 3 | 4 | 5;\n    readImage?: (file: File, field: ImageField) => Promise<string>;\n    say?: (text: string) => void;\n};\nexport type PropertyPanel = {\n    readonly el: HTMLElement;\n    refresh(): void;\n    focus(key: string): boolean;\n    problems(): Problem[];\n    setLive(live: boolean): void;\n    dispose(): void;\n};\nexport declare function shrinkImage(file: Blob, maxSide?: number, quality?: number): Promise<string>;\nexport declare function propertyPanel(host: HTMLElement, o: PropertyPanelOptions): PropertyPanel;\nexport declare function describeValue(f: Field, v: unknown): string;"
        },
        {
          "file": "schema.ts",
          "declarations": "type Base = {\n    key: string;\n    label: string;\n    hint?: string;\n    group?: string;\n    showIf?: (values: Values) => boolean;\n};\nexport type NumberField = Base & {\n    kind: 'number';\n    min: number;\n    max: number;\n    step?: number;\n    unit?: string;\n};\nexport type ToggleField = Base & {\n    kind: 'toggle';\n    on?: string;\n    off?: string;\n};\nexport type ChoiceField = Base & {\n    kind: 'choice';\n    options: ReadonlyArray<{\n        value: string;\n        label: string;\n    }>;\n    as?: 'list' | 'buttons';\n};\nexport type ColourField = Base & {\n    kind: 'colour';\n    optional?: boolean;\n    placeholder?: string;\n};\nexport type DateField = Base & {\n    kind: 'date';\n    yearly?: boolean;\n    optional?: boolean;\n    min?: string;\n    max?: string;\n};\nexport type ImageField = Base & {\n    kind: 'image';\n    maxSide?: number;\n    quality?: number;\n};\nexport type TextField = Base & {\n    kind: 'text';\n    pattern?: RegExp;\n    patternHint?: string;\n    optional?: boolean;\n    maxLength?: number;\n    placeholder?: string;\n};\nexport type Field = NumberField | ToggleField | ChoiceField | ColourField | DateField | ImageField | TextField;\nexport type FieldKind = Field['kind'];\nexport type Values = Record<string, unknown>;\nexport type Kind<T extends Values = Values> = {\n    label: string;\n    hint?: string;\n    fields: readonly Field[];\n    make: () => T;\n};\nexport type Catalog<T extends Values = Values> = Record<string, Kind<T>>;\nexport declare function valueAt(values: Values | null | undefined, key: string): unknown;\nexport declare function withValue<T extends Values>(values: T, key: string, value: unknown): T;\nexport declare function readNumber(text: string): number | null;\nexport declare function fitNumber(f: NumberField, n: number): number;\nexport declare const isColour: (text: string) => boolean;\nexport declare function hexOf(text: string): string | null;\nexport declare function isDay(text: string): boolean;\nexport declare function isYearlyDay(text: string): boolean;\nexport declare function shownValue(f: Field, values: Values, defaults?: Values | null): unknown;\nexport declare function checkValue(f: Field, value: unknown): string | null;\nexport type Problem = {\n    key: string;\n    label: string;\n    message: string;\n};\nexport declare function checkAll(fields: readonly Field[], values: Values, defaults?: Values | null): Problem[];\nexport declare function groupsOf(fields: readonly Field[]): Array<{\n    group: string;\n    fields: Field[];\n}>;\nexport declare function changedKeys(fields: readonly Field[], values: Values, base: Values | null | undefined): Set<string>;\nexport declare function kindFields(catalog: Catalog, kind: string, under: string, group?: string): Field[];\nexport declare const kindOptions: (catalog: Catalog) => Array<{\n    value: string;\n    label: string;\n}>;\nexport {};"
        }
      ],
      "pitfalls": [
        "Import property-panel.base.css, then property-panel.css (or your own look instead)",
        "The panel never keeps its own copy",
        "Stored copies are untrusted",
        "When an id can be edited (a copy of your own), check it against the ids taken before saving",
        "Save must refuse, not clamp",
        "A field whose key is a path (\"pattern.spacing\") is written with withValue",
        "When a choice picks a kind from a catalog",
        "An image is kept in the value as a JPEG data URL, scaled to maxSide (1100 px by default)",
        "The window lives in a positioned container and fits itself to it (a ResizeObserver refits it)",
        "Docked windows should push the work aside, not cover it",
        "The window is non-modal (role dialog, aria-modal false)"
      ],
      "card": "entries/property-panel.json"
    },
    {
      "id": "pure-css-interactions",
      "aliases": [],
      "name": "Interactions with zero JavaScript",
      "summary": "Eight patterns that run with no script, each one CSS file and the markup it reads: a camera flown over a 3D terrace model by transitions on typed properties, marks travelling along paths (offset-path), a day replayed by scrolling (a scroll timeline driving typed properties), numbers that count (animated integers printed by counters), widgets that answer their own size (container queries in a frame you size), a tab indicator that follows by anchor positioning, an accordion that keeps one section open (<details name>, sliding open by ::details-content), and a list sorted, filtered and themed by :has(). Real form controls underneath, so each works from the keyboard and is read by screen readers; each falls back cleanly where a feature is missing. Small TypeScript functions write the markup (at build time or on the server); nothing runs in the page.",
      "category": "ui",
      "role": "interaction",
      "stack": [
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "css",
        "no javascript",
        ":has()",
        "anchor positioning",
        "scroll-driven animations",
        "scroll timeline",
        "@property",
        "css counters",
        "offset-path",
        "motion path",
        "container queries",
        "css 3d",
        "clip-path",
        "tabs",
        "accordion",
        "details",
        "disclosure",
        "sorting",
        "filtering",
        "themes",
        "progressive enhancement",
        "keyboard",
        "accessibility",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "pages that work with scripts off",
        "static, docs and server-rendered pages",
        "tabs and switches with a sliding indicator",
        "a settings panel or inspector, one section open at a time",
        "questions and answers that fold",
        "sorting and filtering a short list",
        "a day or a history you scrub by scrolling",
        "figures and clocks that count",
        "animated flows on a map or diagram",
        "a 3D overview that flies to places",
        "widgets that fit any panel"
      ],
      "interaction": "Click, Tab and the arrows on any control · scroll the bars · Sections: open one, and the open one closes",
      "kits": [],
      "pairsWith": [
        {
          "id": "micro-interactions",
          "why": "Script-driven moments where CSS stops"
        },
        {
          "id": "tabs-tooltips",
          "why": "Tabs and tooltips with the keyboard done properly"
        }
      ],
      "variants": [],
      "version": "1.1.2",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured while the demo walks itself through the patterns (a new one every 2.5 s, the camera flying to a new place in between): style, layout and paint of CSS-only interactions. No script runs in the patterns; the demo only checks radios."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 0.01,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 177 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.02,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 448 ms."
        }
      ],
      "signatures": [
        {
          "file": "anchor-tabs.ts",
          "declarations": "export type AnchorTab = {\n    id: string;\n    label: string;\n    panel?: string;\n    hint?: string;\n};\nexport type AnchorTabsOptions = {\n    name: string;\n    label: string;\n    tabs: AnchorTab[];\n    selected?: string;\n    variant?: 'pill' | 'line';\n    className?: string;\n};\nexport declare function anchorTabs({ name, label, tabs, selected, variant, className }: AnchorTabsOptions): string;"
        },
        {
          "file": "css-camera.ts",
          "declarations": "export type CameraView = {\n    x: number;\n    y: number;\n    tilt: number;\n    spin: number;\n    zoom: number;\n};\nexport type CameraPlace = {\n    id: string;\n    label: string;\n    x: number;\n    y: number;\n    level: number;\n    figure?: string;\n    note?: string;\n    tone?: 'bad' | 'warn';\n    view?: Partial<CameraView>;\n};\nexport type TerraceCameraOptions = {\n    name: string;\n    label: string;\n    width: number;\n    height: number;\n    terraces: string[];\n    places: CameraPlace[];\n    overview?: Partial<CameraView> & {\n        label?: string;\n        note?: string;\n    };\n    step?: number;\n    tagBox?: CameraBox;\n};\nexport type CameraBox = {\n    width: number;\n    height: number;\n};\nexport declare function projectPoint(x: number, y: number, z: number, v: CameraView, planeW: number, box: CameraBox): {\n    sx: number;\n    sy: number;\n    f: number;\n};\nexport type TagOptions = {\n    box?: CameraBox;\n    step?: number;\n    fontPx?: number;\n    beamPx?: number;\n    liftPx?: number;\n};\nexport declare function tagLifts(places: ReadonlyArray<CameraPlace>, v: CameraView, planeW: number, o?: TagOptions): number[];\nexport declare function cameraRules(scope: string, views: readonly CameraView[]): string[];\nexport declare function terraceCamera(o: TerraceCameraOptions): string;"
        },
        {
          "file": "css-counters.ts",
          "declarations": "export type Period = {\n    id: string;\n    label: string;\n    value: number;\n    text: string;\n    share?: number;\n};\nexport type LiveNumberOptions = {\n    name: string;\n    label: string;\n    periods: Period[];\n    selected?: string;\n    tick?: boolean;\n    ring?: string;\n    separator?: string;\n};\nexport declare function groups(n: number): {\n    m: number;\n    k: number;\n    u: number;\n};\nexport declare function formatGroups(n: number, sep?: string): string;\nexport declare function liveNumber(o: LiveNumberOptions): string;\nexport declare function clock({ startMinute, label }: {\n    startMinute: number;\n    label?: string;\n}): string;"
        },
        {
          "file": "exclusive-accordion.ts",
          "declarations": "export type AccordionSection = {\n    id: string;\n    title: string;\n    note?: string;\n    body: string;\n    open?: boolean;\n};\nexport type AccordionOptions = {\n    name: string;\n    label: string;\n    sections: AccordionSection[];\n    exclusive?: boolean;\n    fallback?: string;\n    count?: string;\n    narrow?: boolean | 'auto';\n    className?: string;\n};\nexport declare function openAtStart(sections: AccordionSection[], exclusive?: boolean): boolean[];\nexport declare function accordion({ name, label, sections, exclusive, fallback, count, narrow, className }: AccordionOptions): string;"
        },
        {
          "file": "has-state.ts",
          "declarations": "export type Cell = string | {\n    text: string;\n    bar?: number;\n    tone?: 'bad' | 'warn' | 'ok';\n    mono?: boolean;\n};\nexport type ListRow = {\n    cells: Cell[];\n    flags?: string[];\n};\nexport type ListOptions = {\n    name: string;\n    label: string;\n    columns: string[];\n    rows: ListRow[];\n    sorts: Array<{\n        id: string;\n        label: string;\n        compare: (a: ListRow, b: ListRow) => number;\n    }>;\n    filters?: Array<{\n        id: string;\n        label: string;\n    }>;\n    shown?: string;\n    empty?: string;\n    widths?: string[];\n};\nexport declare function emptyCombos(rows: readonly ListRow[], filterIds: readonly string[]): number[][];\nexport declare function sortFilterList(o: ListOptions): string;\nexport type ThemeOptions = {\n    name: string;\n    label?: string;\n    themes: Array<{\n        id: string;\n        label: string;\n    }>;\n    selected?: string;\n};\nexport declare function themeSwitch({ name, label, themes, selected }: ThemeOptions): string;"
        },
        {
          "file": "scroll-scrub.ts",
          "declarations": "export type ScrubPoint = {\n    hour: number;\n    value: number;\n    light?: number;\n    text: string;\n    target?: number;\n};\nexport type ScrubOptions = {\n    name: string;\n    title: string;\n    label: string;\n    points: ScrubPoint[];\n    decimals?: 0 | 1 | 2;\n    unit?: string;\n    hint?: string;\n    sky?: boolean;\n};\nexport declare const scrubName: (name: string) => string;\nexport declare function scrubKeyframes(name: string, points: readonly ScrubPoint[]): string;\nexport declare function scrubber(o: ScrubOptions): string;"
        },
        {
          "file": "terrain.ts",
          "declarations": "export declare function pcg(v: number): number;\nexport declare function valueNoise(x: number, y: number, seed: number): number;\nexport type IslandOptions = {\n    width?: number;\n    height?: number;\n    cells?: number;\n    seed?: number;\n    rough?: number;\n    warp?: number;\n};\nexport type HeightField = {\n    heights: Float32Array;\n    nx: number;\n    nz: number;\n    width: number;\n    height: number;\n};\nexport declare function islandHeights({ width, height, cells, seed, rough, warp }?: IslandOptions): HeightField;\nexport declare function heightAt(field: HeightField, x: number, y: number): number;\nexport type Terrace = {\n    level: number;\n    path: string;\n    rings: number;\n    points: number;\n};\nexport declare function terraces(field: HeightField, levels: readonly number[], { eps, minArea }?: {\n    eps?: number | undefined;\n    minArea?: number | undefined;\n}): Terrace[];\nexport declare const evenLevels: (count: number, top?: number) => number[];\nexport declare function terraceAt(field: HeightField, levels: readonly number[], x: number, y: number): number;"
        }
      ],
      "pitfalls": [
        "Radio and checkbox names are page-wide",
        ":has() cannot hold another :has(), not even inside :is()",
        "The static CSS reaches options by position, with a line for each",
        "Theme colours can be set on any ancestor",
        "Sorting keeps one pre-sorted copy of the rows a sort, so the reading order is the order you see",
        "Counters are generated content",
        "Where anchor-scope is missing (Chrome has it from 131; check the others before you rely on it)",
        "The scrubber’s scroller is right to left",
        "offset-distance is not one of the properties browsers reliably animate off the main thread",
        "Each terrace is a full-size 3D layer with a drop-shadow filter",
        "clip-path: path() and offset-path",
        "A panel shown with display",
        "<details name> keeps one section open in Chrome/Edge 120+, Safari 17.2+ and Firefox 130+",
        "Give an accordion’s sections a name of their own",
        "Closing the open section above shifts the one you just opened up the page",
        "In a panel under 300 px, a summary’s note beside its title squeezes both",
        "Animating ::details-content to `auto` needs `interpolate-size: allow-keywords` on an ancestor",
        "In Reflow, a frame you dragged keeps that size as an inline style"
      ],
      "card": "entries/pure-css-interactions.json"
    },
    {
      "id": "quadruped-gait",
      "aliases": [],
      "name": "Quadruped gait",
      "summary": "Four legs that walk, trot and run without a single animation clip. A motor turns and accelerates within the build’s limits; a scheduler lifts each foot at its moment in the cycle, plans where it will land from where the body will be, keeps planted feet fixed to the ground and changes gait only at the end of a cycle; a two-joint IK per leg reaches the soles and says when it can’t. Five builds, uneven ground, footprints at every touchdown, and an inspector that shows the stance and swing schedule with the phase running through it, which you can pause and scrub.",
      "category": "simulation",
      "role": "system",
      "stack": [
        "three",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "quadruped",
        "gait",
        "procedural animation",
        "locomotion",
        "foot placement",
        "inverse kinematics",
        "two-bone ik",
        "stance",
        "swing",
        "trot",
        "walk cycle",
        "terrain",
        "fixed timestep",
        "interpolation",
        "inspector",
        "three.js",
        "no dependencies"
      ],
      "useCases": [
        "animals and creatures in a game, from one mesh rigged once",
        "robots and walkers on uneven ground",
        "a pet, a mount or a companion that follows the player",
        "tuning a gait by eye, with the schedule beside it",
        "foot sounds and dust on touchdown, from a bit mask",
        "a creature that stops cycling when a wall blocks it"
      ],
      "interaction": "Tap the ground to walk there · drag to orbit · W A S D steer · 1–5 builds · P pauses, then scrub the phase",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "humanoid-rig",
          "why": "Two-legged walkers beside the animals"
        },
        {
          "id": "heightfield-chunks",
          "why": "Uneven ground for the feet"
        },
        {
          "id": "walk-grid",
          "why": "Paths to walk"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-13",
          "gpuMs": 0.742,
          "cpuMs": 0.485,
          "cpuP95Ms": 0.68,
          "badge": "moderate",
          "drawCalls": 76,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured wandering by itself over the rolling ground, its speed swept from a walk through the trot to a run and back, with footprints and sole markers on: one controller at 60 Hz, four IK solves a frame and a shadowed sun. Standing still with no prints fading, nothing is drawn at all."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 2.097,
          "cpuMs": 1.505,
          "cpuP95Ms": 1.965,
          "badge": "heavy",
          "drawCalls": 76,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 206 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 1.777,
          "cpuMs": 0.28,
          "cpuP95Ms": 0.46,
          "badge": "moderate",
          "drawCalls": 76,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 645 ms."
        }
      ],
      "signatures": [
        {
          "file": "height-world.ts",
          "declarations": "import type { QuadrupedWorld, Surface } from './quadruped-controller';\nexport type HeightAt = (x: number, z: number) => number;\nexport type HeightWorldOptions = {\n    normalStep?: number;\n    blocked?: (x: number, z: number) => boolean;\n};\nexport declare function heightNormal(height: HeightAt, x: number, z: number, step: number, out: Pick<Surface, 'nx' | 'ny' | 'nz'>): Pick<Surface, \"nx\" | \"nz\" | \"ny\">;\nexport declare function heightWorld(height: HeightAt, options?: HeightWorldOptions): QuadrupedWorld;"
        },
        {
          "file": "presets.ts",
          "declarations": "import type { QuadrupedProfile } from './quadruped-controller';\nexport declare const mediumProfile: QuadrupedProfile;\nexport declare const longProfile: QuadrupedProfile;\nexport declare const heavyProfile: QuadrupedProfile;\nexport declare const tallProfile: QuadrupedProfile;\nexport declare const lowProfile: QuadrupedProfile;\nexport declare const quadrupedProfiles: {\n    medium: QuadrupedProfile;\n    long: QuadrupedProfile;\n    heavy: QuadrupedProfile;\n    tall: QuadrupedProfile;\n    low: QuadrupedProfile;\n};\nexport type PresetId = keyof typeof quadrupedProfiles;\nexport declare const QUADRUPED_PRESETS: ReadonlyArray<{\n    id: PresetId;\n    label: string;\n    hint: string;\n}>;"
        },
        {
          "file": "quadruped-controller.ts",
          "declarations": "export type Vec3 = {\n    x: number;\n    y: number;\n    z: number;\n};\nexport declare const LEGS: readonly [\n    \"frontLeft\",\n    \"frontRight\",\n    \"hindLeft\",\n    \"hindRight\"\n];\nexport type LegId = typeof LEGS[number];\nexport type Four<T> = [\n    T,\n    T,\n    T,\n    T\n];\nexport type Gait = {\n    id: string;\n    stride: number;\n    duty: number;\n    lift: number;\n    liftOff: Four<number>;\n    enterSpeed: number;\n    exitSpeed: number;\n};\nexport interface QuadrupedProfile {\n    schemaVersion: 1;\n    id: string;\n    maxSpeed: number;\n    acceleration: number;\n    braking: number;\n    maxYawRate: number;\n    yawAcceleration: number;\n    lateralAcceleration: number;\n    bodyHeight: number;\n    bodyLength: number;\n    bodyWidth: number;\n    colliderRadius: number;\n    colliderHeight: number;\n    maxStep: number;\n    maxDrop: number;\n    maxSlope: number;\n    maxBodyTilt: number;\n    bodyResponse: number;\n    bob: number;\n    feet: Four<Vec3>;\n    gaits: Gait[];\n}\nexport interface Intent {\n    heading: number;\n    speed: number;\n}\nexport interface RootState extends Vec3 {\n    yaw: number;\n    speed: number;\n    yawRate: number;\n    grounded: boolean;\n    verticalSpeed: number;\n}\nexport interface MoveRequest {\n    from: RootState;\n    dx: number;\n    dy: number;\n    dz: number;\n    yaw: number;\n    dt: number;\n    profile: QuadrupedProfile;\n}\nexport interface MoveResult extends Vec3 {\n    yaw: number;\n    grounded: boolean;\n    verticalSpeed: number;\n}\nexport interface Surface extends Vec3 {\n    nx: number;\n    ny: number;\n    nz: number;\n}\nexport interface QuadrupedWorld {\n    move(request: Readonly<MoveRequest>, out: MoveResult): void;\n    ground(x: number, z: number, y: number, out: Surface): boolean;\n}\nexport interface Pose {\n    root: RootState;\n    feet: Four<Vec3>;\n    normals: Four<Vec3>;\n    contacts: Four<boolean>;\n    bodyPitch: number;\n    bodyRoll: number;\n    bodyLift: number;\n    phase: number;\n    gait: string;\n}\nexport interface LegView {\n    swing: boolean;\n    contact: boolean;\n    progress: number;\n    target: Vec3;\n}\nexport declare const createLegView: () => LegView;\nexport declare function createPose(): Pose;\nexport declare function validateProfile(p: QuadrupedProfile): void;\nexport declare class QuadrupedController {\n    readonly profile: QuadrupedProfile;\n    readonly state: RootState;\n    touchdownMask: number;\n    rejectedFootMask: number;\n    constructor(profile: QuadrupedProfile, world: QuadrupedWorld, position?: Vec3, yaw?: number);\n    teleport(position: Vec3, yaw: number): void;\n    fixedStep(intent: Readonly<Intent>, dt?: number): void;\n    currentGait(): Gait;\n    leg(i: number, out: LegView): LegView;\n    sample(alpha: number, out: Pose): void;\n}\nexport declare const flatWorld: QuadrupedWorld;"
        },
        {
          "file": "three-rig.ts",
          "declarations": "import { Object3D } from 'three';\nimport type { Four, Pose, Vec3 } from './quadruped-controller';\nexport interface LegBinding {\n    upper: string;\n    middle: string;\n    end: string;\n    sole: string;\n    pole: Vec3;\n}\nexport interface RigBinding {\n    schemaVersion: 1;\n    body: string;\n    legs: Four<LegBinding>;\n}\nexport declare class ThreeQuadrupedRig {\n    readonly model: Object3D;\n    unreachableMask: number;\n    constructor(model: Object3D, binding: RigBinding);\n    apply(pose: Pose, floatingOrigin: Vec3): void;\n}"
        }
      ],
      "pitfalls": [
        "One fixed clock for every animal (60 Hz), and render sampling once a drawn frame",
        "Read touchdownMask (and rejectedFootMask) right after each fixedStep",
        "The motor moves by what the world allowed, not by what was asked",
        "The world adapter owns collision. move() must write every field of its result",
        "ground() is asked at reset, at every lift-off and at every landing, for this actor only",
        "The rig takes a model wrapper at unit scale, a body that is its direct child",
        "Author the pole (which way the middle joint bends) per leg",
        "The solver never stretches a bone",
        "No AnimationMixer on the same bones at the same time",
        "To change build (a different morphology)",
        "Fixed here, still in the source (HaTac, 5db2c5830)",
        "Gait changes wait for the end of the cycle, and the phase is never reset",
        "Cost grows per animal: four IK solves and the bone updates every drawn frame"
      ],
      "card": "entries/quadruped-gait.json"
    },
    {
      "id": "quiet-charts",
      "aliases": [],
      "name": "Quiet SVG charts",
      "summary": "A Tufte-style chart set as plain functions that return SVG: range-frame column and line charts with direct labels, thresholds and annotations, sparklines, waterfalls, slope graphs, bullet graphs, tier bars and step small multiples. Labels spread so they never overlap, every mark draws itself in like a pen stroke, a marker can ride a line on CSS offset-path (the pen tip as it draws, or a reading that arrives at the latest value), and the colours are CSS variables: restyle it through its parts.",
      "category": "data",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "svg",
        "charts",
        "tufte",
        "sparklines",
        "range frame",
        "waterfall",
        "slope graph",
        "bullet graph",
        "small multiples",
        "offset-path",
        "accessibility",
        "no dependencies"
      ],
      "useCases": [
        "dashboards and reports",
        "KPI cards",
        "finance and P&L views",
        "before-and-after comparisons",
        "progress against target",
        "a marker that travels a line to now",
        "admin panels"
      ],
      "interaction": "Hover or tap a column chart for its figures · Tab to one and use the arrow keys",
      "kits": [
        {
          "kit": "dashboard",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "chart-access",
          "why": "Tables, CSV and words for every chart"
        },
        {
          "id": "more-chart-types",
          "why": "The rarer types in the same style"
        },
        {
          "id": "gauges-rings",
          "why": "KPI gauges beside the charts"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "motion",
          "in": "module",
          "values": {
            "strict": 0,
            "refined": 1,
            "playful": 1
          },
          "note": "reveal(): 0 draws every mark at once"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0.34,
          "cpuP95Ms": 1.025,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured while the data cycles: every frame redraws one of the eleven panels (SVG strings and innerHTML, without the draw-in, which reads each stroke’s length once when a chart first appears), moving to the next data set after each full pass. Idle, the charts cost nothing a frame."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.683,
          "cpuP95Ms": 2.175,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 30 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 1.22,
          "cpuP95Ms": 3.24,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 58 ms."
        }
      ],
      "signatures": [
        {
          "file": "charts.ts",
          "declarations": "export type Fmt = (v: number) => string;\nexport declare function labelWidth(text: string, em?: number): number;\nexport declare const f0: Fmt;\nexport declare const esc: (s: unknown) => string;\nexport declare function niceTicks(min: number, max: number, count?: number): {\n    ticks: number[];\n    min: number;\n    max: number;\n};\nexport declare function reveal(root: Element, { motion, ms }?: {\n    motion?: number;\n    ms?: number;\n}): () => void;\nexport declare function declutter<T extends {\n    y: number;\n}>(items: T[], gap?: number, lo?: number, hi?: number): Array<T & {\n    ly: number;\n}>;\nexport type FrameBar = {\n    values: number[];\n    cls: string;\n    below?: boolean;\n    label?: string;\n    sum?: boolean;\n    fmt?: Fmt;\n};\nexport type FrameLine = {\n    values: number[];\n    cls: string;\n    label?: string;\n    fmt?: Fmt;\n    dots?: boolean;\n};\nexport type FrameRule = {\n    v: number;\n    label: string;\n    cls?: string;\n};\nexport type FrameMark = {\n    i: number;\n    v: number;\n    label: string;\n};\nexport type FrameChartOptions = {\n    n: number;\n    w: number;\n    h: number;\n    labels?: string[];\n    bars?: FrameBar[];\n    lines?: FrameLine[];\n    rules?: FrameRule[];\n    marks?: FrameMark[];\n    fmtY?: Fmt;\n    right?: number;\n    left?: number;\n    xAxis?: boolean;\n    motion?: number;\n    unit?: string;\n    title?: string;\n    desc?: string;\n};\nexport type Column = {\n    x: number;\n    top: number;\n};\nexport type Margins = {\n    l: number;\n    r: number;\n    t: number;\n    b: number;\n};\nexport type FrameChart = {\n    svg: string;\n    cols: Column[];\n    y: (v: number) => number;\n    x: (i: number) => number;\n    m: Margins;\n    iw: number;\n    ih: number;\n};\nexport declare function frameChart(cfg: FrameChartOptions): FrameChart;\nexport declare function sparkline(values: number[], { w, h, cls, title }?: {\n    w?: number;\n    h?: number;\n    cls?: string;\n    title?: string;\n}): string;\nexport type WaterfallStep = {\n    label: string;\n    v: number;\n    kind: 'up' | 'down' | 'total';\n    sub?: string;\n};\nexport declare function waterfall(steps: WaterfallStep[], { w, h, fmt, title, desc }?: {\n    w?: number;\n    h?: number;\n    fmt?: Fmt;\n    title?: string;\n    desc?: string;\n}): string;\nexport type SlopeRow = {\n    label: string;\n    a: number;\n    b: number;\n    cls?: string;\n};\nexport declare function slopeGraph(rows: SlopeRow[], { w, h, left, right, fmt, title, desc }?: {\n    w?: number;\n    h?: number;\n    left?: string;\n    right?: string;\n    fmt?: Fmt;\n    title?: string;\n    desc?: string;\n}): string;\nexport type BulletOptions = {\n    min: number;\n    max: number;\n    value: number;\n    target?: number;\n    w?: number;\n    h?: number;\n    startLabel?: string;\n    endLabel?: string;\n    bands?: number[];\n    title?: string;\n};\nexport declare function bullet({ min, max, value, target, w, h, startLabel, endLabel, bands, title }: BulletOptions): string;\nexport declare function tierBar(have: number, all: number, { w, h, title }?: {\n    w?: number;\n    h?: number;\n    title?: string;\n}): string;\nexport declare function stepSpark(values: number[], max: number, { w, h, title }?: {\n    w?: number;\n    h?: number;\n    title?: string;\n}): string;\nexport type InspectAt = {\n    i: number;\n    x: number;\n    y: number;\n    via: 'pointer' | 'key';\n};\nexport declare function inspect(svg: SVGSVGElement, chart: Pick<FrameChart, 'cols'>, onColumn: (at: InspectAt | null) => void): () => void;"
        },
        {
          "file": "travel.ts",
          "declarations": "export type TravelMode = 'pen' | 'once' | 'loop';\nexport type TravelOptions = {\n    mode?: TravelMode;\n    speed?: number;\n    delay?: number;\n    motion?: number;\n    rotate?: boolean;\n    html?: string;\n    className?: string;\n    origin?: {\n        x: number;\n        y: number;\n    };\n};\nexport type Traveller = {\n    el: HTMLElement;\n    replay(): void;\n    stop(): void;\n};\nexport declare const PEN_EASE = \"cubic-bezier(.45,.05,.25,1)\";\nexport declare function travelTiming(length: number, mode: TravelMode, { speed, delay, d, ms }?: {\n    speed?: number;\n    delay?: number;\n    d?: number;\n    ms?: number;\n}): {\n    delay: number;\n    duration: number;\n    easing: string;\n    iterations: number;\n};\nexport declare function pathData(el: Pick<Element, 'tagName' | 'getAttribute'>): string;\nexport declare function travel(line: SVGGeometryElement, options?: TravelOptions): Traveller;"
        }
      ],
      "pitfalls": [
        "Each chart is drawn at a pixel size",
        "reveal() reads the strokes’ lengths, which forces a layout of the page",
        "The marks take their colours from classes (pos, negb, negl, netl, inv, acc) styled in charts.css",
        "Import charts.base.css before charts.css",
        "frameChart keeps `right` px for the direct labels",
        "Small multiples: give every strip but the bottom one `xAxis: false`",
        "inspect() makes the chart focusable (tabindex 0) and owns the arrow keys while it has focus",
        "Values reach the SVG as text through esc()",
        "Pass motion: 0 to reveal() under prefers-reduced-motion",
        "A traveller’s offset-path is in the SVG’s own pixels",
        "The traveller sits beside the SVG in the host, so replacing the host’s innerHTML removes it",
        "A looping traveller never rests"
      ],
      "card": "entries/quiet-charts.json"
    },
    {
      "id": "race-car",
      "aliases": [],
      "name": "Race car: a 3D driving controller for any racing game",
      "summary": "A car as a rigid body in 3D on four raycast springs, stepped at a fixed 120 Hz with no physics engine: tyres with one grip budget each (a slip curve with a peak and a fall past it, load-sensitive, seven surfaces from asphalt to ice), an engine with a torque curve and revs, automatic or manual gears, front, rear or all-wheel drive through open, limited-slip or locked differentials, brakes with a bias and a handbrake. Assists you can scale or switch off: steering held to the grip, counter-steer help, handbrake swing, power oversteer, momentum recovery, traction control, ABS and stability control. It leaves a ramp along the ramp and flies a true arc, pitches, rolls and yaws in the air, lands on its springs, flips, rolls over and rights itself; its box hull meets ground, walls and ceilings. Ground is one question, a ray, answered by a height function or a triangle mesh with gaps and overhangs. Four cameras (chase, hood, cockpit, top-down), keyboard, gamepad and touch input, and seven presets: kart, rally, GT, drift car, off-road truck, a top-down arcade car and a mid-engined prototype.",
      "category": "simulation",
      "role": "system",
      "stack": [
        "headless",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "vehicle",
        "car",
        "racing",
        "driving",
        "rigid body",
        "raycast suspension",
        "tyre model",
        "friction circle",
        "drivetrain",
        "gearbox",
        "differential",
        "traction control",
        "ABS",
        "drift",
        "jumps",
        "air control",
        "rollover",
        "chase camera",
        "gamepad",
        "touch",
        "fixed step",
        "deterministic",
        "pure",
        "server-safe",
        "no dependencies"
      ],
      "useCases": [
        "a kart, rally, circuit, drift, off-road or top-down racing game",
        "cars on a mesh track with jumps over real gaps, banking, tunnels and walls",
        "drivable vehicles in an open world, on a heightmap",
        "a car stepped on a server or in tests, the same every run",
        "tuning panels and telemetry for car handling",
        "a chase, hood, cockpit or top-down driving camera"
      ],
      "interaction": "Click the course · W A S D or a gamepad · Space handbrake · C camera · drag to look round · R last checkpoint · F right the car",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "game-cameras",
          "why": "Chase and top-down cameras for it"
        },
        {
          "id": "play-input",
          "why": "Steering from keys, pad or touch"
        },
        {
          "id": "mesh-dents",
          "why": "Dents from its impacts"
        }
      ],
      "variants": [],
      "version": "1.0.2",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "Fewer trees and dust puffs.",
          "low": "A 1024 shadow map, half the trees, fewer dust puffs."
        },
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-14",
          "gpuMs": 0.457,
          "cpuMs": 0.72,
          "cpuP95Ms": 1.005,
          "badge": "moderate",
          "drawCalls": 50,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured driving itself: an autopilot laps the course in the rally car (jumps, the banked turn, gravel and the snow), with the chase camera, shadows and dust. The physics steps at 120 Hz on the CPU."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 2.42,
          "cpuMs": 0.38,
          "cpuP95Ms": 0.58,
          "badge": "heavy",
          "drawCalls": 51,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 2931 ms."
        }
      ],
      "signatures": [
        {
          "file": "cameras.ts",
          "declarations": "import type { Ground } from './ground';\nimport { V3, type Quat, type Vec3 } from './math';\nexport type CameraSubject = {\n    readonly position: Vec3;\n    readonly orientation: Quat;\n    readonly velocity: Vec3;\n    readonly airTime: number;\n    readonly steerAngle: number;\n};\nexport type CameraPose = {\n    position: V3;\n    target: V3;\n    up: V3;\n    fov: number;\n};\nexport type CameraKind = 'chase' | 'hood' | 'cockpit' | 'top';\nexport declare const CHASE: {\n    distance: number;\n    height: number;\n    distanceAtSpeed: number;\n    lookHeight: number;\n    ahead: number;\n    aheadMax: number;\n    follow: number;\n    followAir: number;\n    fov: number;\n    fovAtSpeed: number;\n    feelSpeed: number;\n    release: number;\n    margin: number;\n    dip: number;\n    dipMax: number;\n    dipRate: number;\n};\nexport type ChaseTuning = typeof CHASE;\nexport declare const TOP: {\n    down: number;\n    height: number;\n    heightAtSpeed: number;\n    feelSpeed: number;\n    ahead: number;\n    aheadMax: number;\n    follow: number;\n    fov: number;\n};\nexport type TopTuning = typeof TOP;\nexport type CarEyes = {\n    hood: Vec3;\n    cockpit: Vec3;\n};\nexport declare class CarCameras {\n    eyes: CarEyes;\n    kind: CameraKind;\n    reducedMotion: boolean;\n    readonly chase: ChaseTuning;\n    readonly top: TopTuning;\n    readonly pose: CameraPose;\n    constructor(eyes: CarEyes, tuning?: {\n        chase?: Partial<ChaseTuning>;\n        top?: Partial<TopTuning>;\n    });\n    reset(): void;\n    land(speed: number): void;\n    update(car: CameraSubject, dt: number, ground?: Ground): CameraPose;\n}"
        },
        {
          "file": "car.ts",
          "declarations": "import { Gearbox, type GearboxMode } from './drivetrain';\nimport { type Ground, type Surface } from './ground';\nimport { Quat, V3, type Vec3 } from './math';\nimport type { Assists, CarSpec } from './spec';\nexport type { Assists, CarSpec } from './spec';\nexport type CarControls = {\n    throttle: number;\n    brake: number;\n    steer: number;\n    handbrake: number | boolean;\n    shiftUp?: boolean;\n    shiftDown?: boolean;\n    air?: {\n        pitch: number;\n        roll: number;\n        yaw: number;\n    };\n};\nexport declare const NO_CONTROLS: CarControls;\nexport type CarEvent = {\n    type: 'land';\n    x: number;\n    y: number;\n    z: number;\n    speed: number;\n    airTime: number;\n    wheels: number;\n} | {\n    type: 'impact';\n    x: number;\n    y: number;\n    z: number;\n    nx: number;\n    ny: number;\n    nz: number;\n    speed: number;\n    impulse: number;\n} | {\n    type: 'flip';\n    x: number;\n    y: number;\n    z: number;\n} | {\n    type: 'airborne';\n    x: number;\n    y: number;\n    z: number;\n};\nexport type Wheel = {\n    readonly front: boolean;\n    readonly left: boolean;\n    readonly anchor: V3;\n    readonly radius: number;\n    compression: number;\n    contact: boolean;\n    surface: Surface;\n    readonly normal: V3;\n    readonly point: V3;\n    load: number;\n    staticLoad: number;\n    spin: number;\n    angle: number;\n    steer: number;\n    slipRatio: number;\n    slipAngle: number;\n    slip: number;\n    fx: number;\n    fy: number;\n    drive: number;\n    brakeTorque: number;\n    abs: number;\n    lastCompression: number;\n};\nexport declare const CAR_STEP: number;\nexport declare class RaceCar {\n    spec: CarSpec;\n    assists: Assists;\n    readonly position: V3;\n    readonly velocity: V3;\n    readonly orientation: Quat;\n    readonly spin: V3;\n    readonly wheels: Wheel[];\n    readonly gearbox: Gearbox;\n    readonly events: CarEvent[];\n    airTime: number;\n    steerAngle: number;\n    tractionCut: number;\n    stabilityActive: boolean;\n    launchLoss: number;\n    righting: number;\n    readonly previousPosition: V3;\n    readonly previousOrientation: Quat;\n    alpha: number;\n    readonly bodyPose: {\n        heave: number;\n        pitch: number;\n        roll: number;\n    };\n    constructor(spec: CarSpec, options?: {\n        assists?: Partial<Assists>;\n        gearbox?: GearboxMode;\n        position?: Vec3;\n        heading?: number;\n    });\n    retune(spec: CarSpec): void;\n    place(position: Vec3, heading?: number): void;\n    placeOn(ground: Ground, x: number, z: number, heading?: number, fromY?: number): boolean;\n    get speed(): number;\n    get kmh(): number;\n    get contacts(): number;\n    upAxis(out?: V3): V3;\n    get heading(): number;\n    get gearLabel(): string;\n    selfRight(): void;\n    update(dt: number, controls: CarControls, ground: Ground): void;\n    step(c: CarControls, ground: Ground, h: number): void;\n}"
        },
        {
          "file": "ground.ts",
          "declarations": "import { V3, type Vec3 } from './math';\nexport type Surface = 'asphalt' | 'gravel' | 'dirt' | 'sand' | 'snow' | 'grass' | 'ice';\nexport declare const SURFACES: readonly Surface[];\nexport type SurfaceInfo = {\n    grip: number;\n    rolling: number;\n    loose: number;\n    sink: number;\n};\nexport declare const SURFACE_INFO: Record<Surface, SurfaceInfo>;\nexport type GroundHit = {\n    distance: number;\n    normal: V3;\n    surface: Surface;\n};\nexport interface Ground {\n    cast(origin: Vec3, dir: Vec3, maxDist: number): GroundHit | null;\n}\nexport declare function planeGround(y?: number, surface?: Surface): Ground;\nexport type HeightfieldOptions = {\n    height(x: number, z: number): number;\n    surface?(x: number, z: number): Surface;\n    step?: number;\n};\nexport declare function heightfieldGround(options: HeightfieldOptions): Ground;\nexport type MeshGroundOptions = {\n    positions: ArrayLike<number>;\n    indices?: ArrayLike<number>;\n    surfaces?: ArrayLike<number>;\n    surfaceNames?: readonly Surface[];\n    cell?: number;\n};\nexport type MeshGround = Ground & {\n    readonly triangles: number;\n    readonly cols: number;\n    readonly rows: number;\n};\nexport declare function meshGround(options: MeshGroundOptions): MeshGround;\nexport declare function combineGrounds(...grounds: Ground[]): Ground;\nexport declare function groundBelow(ground: Ground, x: number, z: number, fromY: number, depth?: number): {\n    y: number;\n    normal: V3;\n    surface: Surface;\n} | null;"
        },
        {
          "file": "input.ts",
          "declarations": "import type { CarControls } from './car';\nexport type InputSource = 'keyboard' | 'gamepad' | 'touch';\nexport type KeyMap = {\n    throttle: string[];\n    brake: string[];\n    left: string[];\n    right: string[];\n    handbrake: string[];\n    shiftUp: string[];\n    shiftDown: string[];\n    rollLeft: string[];\n    rollRight: string[];\n    reset: string[];\n    camera: string[];\n    selfRight: string[];\n};\nexport declare const KEYS: KeyMap;\nexport type DriveInput = CarControls & {\n    air: {\n        pitch: number;\n        roll: number;\n        yaw: number;\n    };\n    reset: boolean;\n    camera: boolean;\n    selfRight: boolean;\n};\nexport type TouchState = {\n    steer: number;\n    throttle: number;\n    brake: number;\n    handbrake: boolean;\n};\nexport declare class CarInput {\n    source: InputSource;\n    readonly touch: TouchState;\n    readonly map: KeyMap;\n    constructor(target: HTMLElement | Window, map?: Partial<KeyMap>);\n    read(airborne?: boolean): DriveInput;\n    dispose(): void;\n}\nexport declare function mountTouchControls(host: HTMLElement, input: CarInput): {\n    element: HTMLDivElement;\n    dispose(): void;\n};"
        },
        {
          "file": "presets.ts",
          "declarations": "import type { CarSpec } from './spec';\nimport type { TyreSpec } from './tyre';\ndeclare const ROAD: TyreSpec;\nexport declare const KART: CarSpec;\nexport declare const RALLY: CarSpec;\nexport declare const GT: CarSpec;\nexport declare const DRIFT: CarSpec;\nexport declare const TRUCK: CarSpec;\nexport declare const ARCADE: CarSpec;\nexport declare const PROTO: CarSpec;\nexport declare const PRESETS: {\n    readonly kart: CarSpec;\n    readonly rally: CarSpec;\n    readonly gt: CarSpec;\n    readonly drift: CarSpec;\n    readonly truck: CarSpec;\n    readonly arcade: CarSpec;\n    readonly proto: CarSpec;\n};\nexport type PresetId = keyof typeof PRESETS;\nexport { ROAD as ROAD_TYRE };"
        },
        {
          "file": "spec.ts",
          "declarations": "import type { BrakeSpec, DriveSpec, EngineSpec, GearboxSpec } from './drivetrain';\nimport type { Vec3 } from './math';\nimport type { TyreSpec } from './tyre';\nexport type Assists = {\n    steerLimit: number;\n    counterSteer: number;\n    handbrakeYaw: number;\n    powerOversteer: number;\n    momentumRecovery: number;\n    traction: number;\n    abs: number;\n    stability: number;\n    airControl: number;\n    airStability?: number;\n    autoRight: boolean;\n};\nexport type CarSpec = {\n    name: string;\n    mass: number;\n    frontWeight: number;\n    wheelbase: number;\n    track: number;\n    comHeight: number;\n    body: {\n        length: number;\n        width: number;\n        height: number;\n        clearance: number;\n        offsetZ: number;\n    };\n    inertiaScale: number;\n    wheel: {\n        radius: number;\n        width: number;\n        inertia: number;\n    };\n    suspension: {\n        travel: number;\n        frequency: number;\n        damping: number;\n        rebound: number;\n        antiRollFront: number;\n        antiRollRear: number;\n        knee?: number;\n        bumpHigh?: number;\n        reboundHigh?: number;\n        bumpZone?: number;\n    };\n    tyre: TyreSpec;\n    rearTyre?: TyreSpec;\n    steer: {\n        lock: number;\n        speed: number;\n        returnSpeed: number;\n        overdrive: number;\n        alignment: number;\n    };\n    engine: EngineSpec;\n    gearbox: GearboxSpec;\n    drive: DriveSpec;\n    brakes: BrakeSpec;\n    aero: {\n        drag: number;\n        downforce: number;\n    };\n    forceHeight: number;\n    cornerGripLoss?: number;\n    cornerSlipKmh?: number;\n    launchGripLoss?: number;\n    launchGripRecovery?: number;\n    bodyMotion?: number;\n    lean?: {\n        roll: number;\n        pitch: number;\n    };\n    air: {\n        rate: number;\n        authority: number;\n    };\n    restitution: number;\n    bodyFriction: number;\n    hull: Vec3[];\n    assists: Assists;\n    claims: {\n        topKmh: [\n            number,\n            number\n        ];\n        zeroTo100: [\n            number,\n            number\n        ];\n    };\n};\nexport declare function boxHull(spec: Pick<CarSpec, 'body' | 'comHeight' | 'wheelbase' | 'frontWeight'>): Vec3[];\nexport declare function defineCar(spec: Omit<CarSpec, 'hull'>): CarSpec;"
        },
        {
          "file": "tune.ts",
          "declarations": "import { type CarSpec } from './spec';\nexport type TuneValue = number | string;\nexport type TuneValues = Record<string, TuneValue>;\nexport type TuneField = {\n    key: string;\n    group: string;\n    label: string;\n    kind: 'number' | 'select';\n    min?: number;\n    max?: number;\n    step?: number;\n    unit?: string;\n    options?: Array<{\n        value: string;\n        label: string;\n    }>;\n    hint: string;\n    read(spec: CarSpec, base: CarSpec): TuneValue;\n    write(spec: CarSpec, value: TuneValue, base: CarSpec): void;\n};\nexport declare const TUNE_FIELDS: TuneField[];\nexport declare function tuneFromSpec(spec: CarSpec, base?: CarSpec): TuneValues;\nexport declare function specFromTune(base: CarSpec, values: TuneValues): CarSpec;"
        }
      ],
      "pitfalls": [
        "On a weaker GPU (harness tier medium or low) the demo draws a 1024 shadow map at low",
        "The demo's coupé model (`muscle-coupe.glb`) is an original design made after references to a…",
        "`retune` takes a new spec live and keeps each strut where it is in the world",
        "Step it with `update(frameDt, …)`, never `step` with a frame's length",
        "Axes: y up, the nose toward -z at heading 0, positive steer turns left",
        "Ground casts are the whole world for the car",
        "A kerb or step is a contact, not a spring",
        "The hull is checked along rays from the centre of mass",
        "Place a car with `placeOn(ground, x, z, heading)`, not `place`, anywhere that is not flat",
        "A preset of another shape needs a new `RaceCar`",
        "Weight forward does not make a car nose-dive off a jump on its own",
        "A real car keeps the spin it leaves the lip with",
        "forceHeight cancels that share of the roll and pitch moments",
        "`bodyPose` is drawing only",
        "Under 1.5 m/s slip is measured against 1.5 m/s",
        "Traction control feeds forward from the driven tyres' load",
        "In the air, the throttle and brake keys pitch the car only when pressed after take-off",
        "Sprites (dust, smoke, sparks) near a car can show inside it from a hood or cockpit camera"
      ],
      "card": "entries/race-car.json"
    },
    {
      "id": "ragdoll-balance",
      "aliases": [],
      "name": "Ragdoll with balance and stagger",
      "summary": "A pushed body that decides, the same way every time, whether it catches itself. The push becomes a velocity on a body with mass; the point it is heading for (a capture point) is measured against the support between its feet, and that picks a short catch step, a stagger or a scramble of planned steps, each checked for ground before the foot leaves. A small push is taken at the ankles or by bending at the hips, over the outline of its feet. Past its reach, its step budget or its time, it falls, and the fall comes from the hit: where it landed turns the body (a shoulder twists it, a knee sweeps the legs out), a slow fall has a moment of losing it, it goes over as one body about its heels and only then does a knee give (the falling side’s, or the hit side’s), the trunk after, the hands reach for where it will land and give on the touch, and cones keep the hips, shoulders and neck in range. Then it gets up through poses, where it fits: over onto its front, hands and knees, one knee, standing. A plain jointed mannequin draws it.",
      "category": "simulation",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "balanced",
      "tags": [
        "ragdoll",
        "balance",
        "stagger",
        "push recovery",
        "capture point",
        "catch step",
        "hit reaction",
        "controlled fall",
        "shape matching",
        "joint limits",
        "ankle and hip strategy",
        "verlet",
        "position based",
        "constraints",
        "get up",
        "procedural animation",
        "deterministic",
        "fixed timestep",
        "mannequin",
        "three.js",
        "no dependencies",
        "rests when idle"
      ],
      "useCases": [
        "characters that react to being bumped, shoved or caught by a crowd",
        "a body that stumbles and recovers before it ever falls over",
        "falls that come from where the hit landed: a shoulder turns it, a knee sweeps its legs, a chest topples it",
        "a fall that catches itself on its hands, and a get-up that reads as a person, not a morph",
        "falls that land against walls and ledges instead of through them",
        "a server and every client agreeing on whether someone fell",
        "teaching balance: support, capture point and recovery steps",
        "a test dummy for doors, moving platforms and crowds that push"
      ],
      "interaction": "Click a part of the mannequin to hit it there · drag across it to aim and size the hit · Slow, Limp (before) and Same hit again in the card · orbit to look round",
      "kits": [],
      "pairsWith": [
        {
          "id": "humanoid-rig",
          "why": "The rig it catches or drops"
        },
        {
          "id": "breakable-world",
          "why": "Pushes from blasts and falling rubble"
        },
        {
          "id": "traversal",
          "why": "Getting up and moving on"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-13",
          "gpuMs": 0.49,
          "cpuMs": 0.415,
          "cpuP95Ms": 0.645,
          "badge": "light",
          "drawCalls": 9,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Knocked over by a 420 N·s chest hit on its first frame, so the measured frames are the controlled fall; after that it pushes itself every 2.4 s while standing, round the compass and at different parts, alternating a sway, a stagger and a fall: the balance and catch steps, or the controlled fall (shape matching, reach, limits) and the get-up through poses, on the fixed 60 Hz tick; the mannequin as three instanced meshes, one shadowed key light and a room environment."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 2.032,
          "cpuMs": 0.65,
          "cpuP95Ms": 1.06,
          "badge": "heavy",
          "drawCalls": 9,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 308 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 1.667,
          "cpuMs": 0.28,
          "cpuP95Ms": 0.54,
          "badge": "moderate",
          "drawCalls": 12,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 362 ms."
        }
      ],
      "signatures": [
        {
          "file": "body.ts",
          "declarations": "import { BalanceController, type BalanceTuning, type Impact } from './balance';\nimport { type StanceBody } from './body-frame';\nimport { Feet, type FeetWorld } from './feet';\nimport { type Vec3 } from './math';\nimport { Ragdoll, type RagdollSettling } from './ragdoll';\nimport { type Root } from './skeleton';\nexport type BodyState = 'standing' | 'toppling' | 'down' | 'rising';\nexport type BodyWorld = FeetWorld;\nexport type FallStyle = {\n    controlled: boolean;\n    hold: number;\n    tone: number;\n    losing: number;\n    losingBelow: number;\n    grip: number;\n    jolt: number;\n    fastest: number;\n    getUp: 'poses' | 'crouch';\n};\nexport declare const DEFAULT_FALL: FallStyle;\nexport type PushableOptions = {\n    world: BodyWorld;\n    x?: number;\n    z?: number;\n    facing?: number;\n    mass?: number;\n    tuning?: BalanceTuning;\n    settling?: RagdollSettling;\n    lieFor?: number;\n    riseFor?: number;\n    seed?: number;\n    body?: StanceBody;\n    scale?: number;\n    fall?: Partial<FallStyle>;\n    support?: 'polygon' | 'segment';\n};\nexport declare class PushableBody {\n    readonly balance: BalanceController;\n    readonly feet: Feet;\n    ragdoll: Ragdoll | null;\n    state: BodyState;\n    readonly root: Root;\n    readonly positions: Float64Array<ArrayBuffer>;\n    readonly previous: Float64Array<ArrayBuffer>;\n    settling: RagdollSettling;\n    lieFor: number;\n    riseFor: number;\n    fall: FallStyle;\n    support: 'polygon' | 'segment';\n    readonly walk: {\n        x: number;\n        z: number;\n    };\n    lying: number;\n    rise: number;\n    toppling: number;\n    reason: string;\n    fellBecause: string;\n    landing: Vec3 | null;\n    readonly spin: Vec3;\n    low: number;\n    hitSide: 'L' | 'R' | null;\n    readonly tilt: Vec3;\n    readonly tiltRate: Vec3;\n    readonly body: StanceBody;\n    readonly scale: number;\n    lost: boolean;\n    constructor(options: PushableOptions);\n    get hipHeight(): number;\n    reset(x?: number, z?: number, facing?: number): void;\n    push(push: Impact): void;\n    get moving(): boolean;\n    capture(out: {\n        x: number;\n        z: number;\n    }): {\n        x: number;\n        z: number;\n    };\n    supportOutline(): {\n        corners: number;\n        points: Float64Array<ArrayBuffer>;\n    };\n    tick(dt?: number): void;\n    sample(alpha: number, out: Float64Array): Float64Array<ArrayBufferLike>;\n}"
        },
        {
          "file": "skeleton.ts",
          "declarations": "import { type StanceBody, type StanceKey } from './body-frame';\nimport type { Vec3 } from './math';\nexport declare const JOINTS: readonly [\n    \"Hips\",\n    \"Spine\",\n    \"Chest\",\n    \"Neck\",\n    \"Head\",\n    \"UpperArmL\",\n    \"LowerArmL\",\n    \"HandL\",\n    \"UpperArmR\",\n    \"LowerArmR\",\n    \"HandR\",\n    \"UpperLegL\",\n    \"LowerLegL\",\n    \"FootL\",\n    \"BallL\",\n    \"UpperLegR\",\n    \"LowerLegR\",\n    \"FootR\",\n    \"BallR\"\n];\nexport type JointName = (typeof JOINTS)[number];\nexport declare const PARENTS: Int16Array<ArrayBuffer>;\nexport declare const J: Record<JointName, number>;\nexport declare const JOINT_COUNT: 19;\nexport type Root = {\n    x: number;\n    y: number;\n    z: number;\n    facing: number;\n};\nexport declare function twoBone(a: Vec3, target: Vec3, l1: number, l2: number, pole: Vec3, mid: Vec3, end: Vec3): boolean;\nexport declare function solveJoints(body: StanceBody, scale: number, root: Root, key: StanceKey, out: Float64Array): Float64Array<ArrayBufferLike>;\nexport declare function toWorld(model: readonly Vec3[], scale: number, root: Root, out: Float64Array): Float64Array<ArrayBufferLike>;\nexport declare function toModel(x: number, y: number, z: number, scale: number, root: Root, out: Vec3): Vec3;\nexport declare function boneLengths(positions: Float64Array): Float64Array<ArrayBuffer>;\nexport declare function keepLengths(positions: Float64Array, lengths: Float64Array): Float64Array<ArrayBufferLike>;\nexport declare const BONES: ReadonlyArray<readonly [\n    JointName,\n    JointName,\n    number\n]>;\nexport declare const HEAD_RADIUS = 0.11;\nexport declare function hitBody(positions: Float64Array, ox: number, oy: number, oz: number, dx: number, dy: number, dz: number, size?: number): {\n    t: number;\n    joint: number;\n    x: number;\n    y: number;\n    z: number;\n} | null;"
        },
        {
          "file": "three-mannequin.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nexport type MannequinLook = {\n    limb: THREE.ColorRepresentation;\n    joint: THREE.ColorRepresentation;\n    roughness?: number;\n};\nexport declare class MannequinView {\n    readonly group: THREE.Group<THREE.Object3DEventMap>;\n    readonly limbMaterial: THREE.MeshStandardNodeMaterial;\n    readonly jointMaterial: THREE.MeshStandardNodeMaterial;\n    constructor(look: MannequinLook, size?: number);\n    update(p: ArrayLike<number>): void;\n    setLook(look: MannequinLook): void;\n    dispose(): void;\n}\nexport declare const MANNEQUIN_JOINTS: 19;"
        }
      ],
      "pitfalls": [
        "Everything runs on a fixed 1/60 s tick, and tick() refuses anything else",
        "The verdict is deterministic and the seed only picks a gesture",
        "Pushes are impulses in N·s at a point over the ground",
        "The motor must carry the push through collision and report back",
        "A catch step is planned, not hoped for",
        "The ragdoll takes its bone lengths and trunk braces from the pose it starts in",
        "Its joint radii are tuned for a 0.83 m hip height",
        "Most of the time on the floor is the ragdoll settling before it sleeps",
        "A body pushed into a wall has joints stopped on the wall’s own line",
        "The get-up blends joint positions, which shortens bones mid-blend",
        "A muscle inside the ragdoll must not move the body",
        "A joint limit corrected in the position alone becomes speed",
        "A shape-matching cluster needs three points off one line",
        "How a hard hit ends up lying is chaotic, as in life",
        "Toppling (losing it) holds the root and tips the pose about the feet",
        "Nothing here moves a skinned mesh",
        "A world whose height() answers null under a fallen body (off its edge) has nothing to land on",
        "Asleep, the ragdoll costs nothing, and moving is false once a standing body has settled"
      ],
      "card": "entries/ragdoll-balance.json"
    },
    {
      "id": "rain-snow",
      "aliases": [],
      "name": "GPU rain and snow with a seeded weather model",
      "summary": "Every drop and flake placed by its index alone, so the CPU only writes a few uniforms (about 0.01 ms a frame): streaks, splashes, rings on water, wet and glossy surfaces and settling snow, kept off by roofs, driven by a weather model that is a plain function of world seed, day and biome.",
      "category": "particles",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "balanced",
      "tags": [
        "rain",
        "snow",
        "weather",
        "instancing",
        "procedural",
        "wet surfaces",
        "lightning",
        "seeded",
        "tsl"
      ],
      "useCases": [
        "open-world weather",
        "rain on water and puddles",
        "shelters and interiors that stay dry",
        "snow that settles and melts",
        "day and night cycles",
        "weather a server can own"
      ],
      "interaction": "Drag to orbit · click, then scroll to zoom · pick a biome to change the place · in Seeded days, drag the timeline to move the clock",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "cloud-shadows",
          "why": "Clouds over the weather"
        },
        {
          "id": "compile-without-stalls",
          "why": "Wind and wetness every material reads once a frame"
        },
        {
          "id": "water-ripples",
          "why": "Rings on water from the rain"
        }
      ],
      "variants": [],
      "version": "1.0.2",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-17",
          "gpuMs": 1.133,
          "cpuMs": 0.32,
          "cpuP95Ms": 0.525,
          "badge": "moderate",
          "drawCalls": 23,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.505,
            "p99Ms": 6.805,
            "low1Fps": 141.3
          },
          "notes": "Runs a downpour whatever the controls say (rain 0.9, wind 4 m/s, 20:30, the ground soaked), in the default biome, the rainforest (its trees and bushes merged into one mesh per material, about 50,000 vertices): some 30,000 streaks and 17,000 splashes (more on a wider stage), one instanced draw each, with the rings on the pond and puddles and the wet, glossy ground. The CPU writes a few uniforms and the instance counts a frame."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 9.306,
          "cpuMs": 1.13,
          "cpuP95Ms": 1.58,
          "badge": "heavy",
          "drawCalls": 23,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 1761 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 6.374,
          "cpuMs": 1,
          "cpuP95Ms": 1.36,
          "badge": "heavy",
          "drawCalls": 23,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 1745 ms."
        }
      ],
      "signatures": [
        {
          "file": "precipitation.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { type Climate, type WeatherState, type Wetness } from './weather';\nimport type { Daylight } from './world-clock';\nimport { type RainBox, type RainLook, type RainQuality, type RainView } from './rain-look';\nimport { type SnowLook, type SnowQuality } from './snow-look';\nexport type PrecipitationFrame = {\n    dt: number;\n    days: number;\n    hour: number;\n    weather: WeatherState;\n    seeded?: {\n        seed: number;\n        climate: Climate;\n    };\n    camera: THREE.Camera;\n    centre: {\n        x: number;\n        y: number;\n        z: number;\n    };\n    reach?: number;\n    wind: {\n        x: number;\n        z: number;\n    };\n    width: number;\n    height: number;\n    light: Daylight;\n};\nexport type StopFieldSource = {\n    centre: {\n        x: number;\n        z: number;\n    };\n    cell?: number;\n    ground: (x: number, z: number) => number;\n    water?: (x: number, z: number) => number;\n    roof?: (x: number, z: number) => number | null;\n};\nexport type StopField = {\n    x0: number;\n    z0: number;\n    cell: number;\n    ref: number;\n    roofs: Float32Array;\n};\nexport declare function writeStopField(source: StopFieldSource): StopField;\nexport declare function viewOf(camera: THREE.Camera, y: number, reach?: number): RainView;\nexport declare function pixelsPerMetre(camera: THREE.Camera, at: {\n    x: number;\n    y: number;\n    z: number;\n}, height: number): number;\nexport declare class Precipitation {\n    readonly object3D: THREE.Group<THREE.Object3DEventMap>;\n    rain: number;\n    storm: number;\n    snow: number;\n    windiness: number;\n    readonly wetness: Wetness;\n    snowCover: number;\n    flash: number;\n    gust: number;\n    constructor(seed?: number);\n    setStopField(source: StopFieldSource): StopField;\n    warm(renderer: THREE.WebGPURenderer, camera: THREE.Camera, scene: THREE.Scene): Promise<void>;\n    setQuality(quality: RainQuality): void;\n    setSnowQuality(quality: SnowQuality): void;\n    readonly look: RainLook;\n    setLook(change: Partial<RainLook>): void;\n    readonly snowLook: SnowLook;\n    setSnowLook(change: Partial<SnowLook>): void;\n    strike(): void;\n    get clock(): number;\n    soak(level: number): void;\n    settle(level: number): void;\n    get drawn(): boolean;\n    get snowDrawn(): boolean;\n    get settled(): number;\n    get overcast(): number;\n    get snowy(): number;\n    get stormy(): number;\n    openAt(x: number, y: number, z: number): boolean;\n    update(frame: PrecipitationFrame): void;\n    dispose(): void;\n    get state(): {\n        rain: number;\n        storm: number;\n        wet: number;\n        pools: number;\n        flash: number;\n        gust: number;\n        drops: number;\n        splashes: number;\n        snow: number;\n        blizzard: number;\n        cover: number;\n        flakes: number;\n        box: (RainBox & {\n            spread: number;\n        }) | null;\n        quality: RainQuality;\n        snowQuality: SnowQuality;\n    };\n}\nexport declare function rainColour(look: Daylight): [\n    number,\n    number,\n    number\n];\nexport declare function snowColour(look: Daylight): [\n    number,\n    number,\n    number\n];"
        },
        {
          "file": "rain-look.ts",
          "declarations": "import type { Daylight } from './world-clock';\nexport type RainQuality = 'off' | 'low' | 'high';\nexport declare const RAIN_QUALITIES: readonly RainQuality[];\nexport declare const DEFAULT_RAIN: RainQuality;\nexport declare const RAIN_LOOK: {\n    readonly drops: {\n        readonly low: 3500;\n        readonly high: 9000;\n    };\n    readonly splashes: {\n        readonly low: 2000;\n        readonly high: 6000;\n    };\n    readonly thin: 0.8;\n    readonly column: 16;\n    readonly fall: readonly [\n        6.5,\n        9.5\n    ];\n    readonly length: readonly [\n        0.45,\n        0.95\n    ];\n    readonly least: 9;\n    readonly width: {\n        readonly low: 1.6;\n        readonly high: 1.25;\n    };\n    readonly alpha: readonly [\n        0.22,\n        0.42\n    ];\n    readonly splashLife: 0.12;\n    readonly splashEvery: 0.7;\n    readonly splashSize: 0.05;\n    readonly splashLeast: 2;\n};\nexport type RainLook = {\n    drops: number;\n    splashes: number;\n    length: number;\n    opacity: number;\n    width: number;\n    slant: number;\n};\nexport declare const RAIN_LOOK_KNOBS: Record<keyof RainLook, {\n    label: string;\n    min: number;\n    max: number;\n    step: number;\n    recommended: number;\n    hint: string;\n}>;\nexport declare const MOST = 4;\nexport declare const DEFAULT_RAIN_LOOK: RainLook;\nexport declare function rainShare(amount: number): number;\nexport type RainView = {\n    x: number;\n    z: number;\n    right: {\n        x: number;\n        z: number;\n    };\n    forward: {\n        x: number;\n        z: number;\n    };\n    halfWidth: number;\n    halfHeight: number;\n    pitch: number;\n};\nexport type RainBox = {\n    x: number;\n    z: number;\n    across: number;\n    along: number;\n};\nexport declare const BOX_STEP = 8;\nexport declare function rainBox(view: RainView, column: number, slant: {\n    x: number;\n    z: number;\n}): RainBox;\nexport declare function rainSquare(view: RainView, column: number, slant: {\n    x: number;\n    z: number;\n}, mostSlant: number): RainBox & {\n    spread: number;\n};\nexport declare const LIGHTNING: {\n    readonly slot: 9;\n    readonly chance: 0.75;\n    readonly least: 0.25;\n    readonly rise: 0.012;\n    readonly decay: 0.07;\n    readonly gap: readonly [\n        0.06,\n        0.22\n    ];\n    readonly strokes: 3;\n};\nexport declare function strokesOf(roll: (channel: number) => number): {\n    at: number;\n    strength: number;\n}[];\nexport declare function strikeLight(dt: number, roll: (channel: number) => number): number;\nexport declare function lightningAt(seed: number, time: number, storm: number): number;\nexport type Strike = {\n    start: number;\n    roll: (channel: number) => number;\n};\nexport declare function strikesBetween(seed: number, from: number, to: number, storm: number): Strike[];\nexport declare const STORM_LIGHT: {\n    readonly sun: 0.75;\n    readonly nightSun: 0.45;\n    readonly sunGrey: \"#b8c2cc\";\n    readonly sky: \"#5b6774\";\n    readonly nightSky: \"#141a22\";\n    readonly hemi: \"#8794a0\";\n    readonly nightHemi: \"#26344a\";\n    readonly hemiLeft: 0.78;\n    readonly flashSky: \"#c9d6ff\";\n    readonly flashLight: \"#e3ebff\";\n    readonly flash: 2.4;\n    readonly snowSun: 0.62;\n    readonly snowSky: \"#a3acb6\";\n    readonly snowNightSky: \"#1c222b\";\n    readonly snowHemi: \"#b9c3ce\";\n    readonly snowNightHemi: \"#2a3440\";\n    readonly snowHemiLeft: 0.9;\n};\nexport declare function stormLight(look: Daylight, overcast: number, flash: number, snowy?: number): Daylight;"
        },
        {
          "file": "rain-nodes.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\ntype F = Node<'float'>;\ntype U = Node<'uint'>;\ntype V2 = Node<'vec2'>;\ntype V3 = Node<'vec3'>;\nexport declare const rainUniforms: {\n    amount: THREE.UniformNode<\"float\", number>;\n    fall: THREE.UniformNode<\"float\", number>;\n    splash: THREE.UniformNode<\"float\", number>;\n    box: THREE.UniformNode<\"vec4\", THREE.Vector4>;\n    axes: THREE.UniformNode<\"vec4\", THREE.Vector4>;\n    slant: THREE.UniformNode<\"vec2\", THREE.Vector2>;\n    look: THREE.UniformNode<\"vec4\", THREE.Vector4>;\n    colour: THREE.UniformNode<\"color\", THREE.Color>;\n    screen: THREE.UniformNode<\"vec3\", THREE.Vector3>;\n    field: THREE.UniformNode<\"vec4\", THREE.Vector4>;\n    wet: THREE.UniformNode<\"float\", number>;\n    pools: THREE.UniformNode<\"float\", number>;\n    rings: THREE.UniformNode<\"float\", number>;\n};\nexport declare const RAIN_FIELD_CELLS = 128;\nexport declare const RAIN_FIELD_CELL = 0.5;\nexport declare const NO_ROOF = -1000;\nexport declare const rainSurface: THREE.DataTexture;\nexport declare const rainRoof: THREE.DataTexture;\nexport declare const rainRoofAt: (p: V2) => F;\nexport declare const rainWaterDepth: (p: V2) => F;\nexport declare const rainLandAt: (p: V2) => V2;\nexport declare const rainStopAt: (p: V2) => F;\nexport declare const hash41: THREE.TSL.FnNode<[\n    U\n], THREE.JoinNode<\"vec4\">>;\nexport declare const hash33: THREE.TSL.FnNode<[\n    THREE.Node<\"vec2\"> | THREE.Vector2,\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">\n], THREE.JoinNode<\"vec3\">>;\nexport declare const NEAR_FADE: readonly [\n    0.6,\n    2.2\n];\nexport declare const nearFade: (p: V3) => F;\nexport declare const DROP_RANGE: {\n    readonly drops: 0;\n    readonly splashes: number;\n    readonly flakes: number;\n    readonly flakeOwn: number;\n};\nexport declare const rainDrop: THREE.TSL.FnNode<[\n    U,\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">,\n    THREE.Node<\"vec4\"> | THREE.Vector4,\n    THREE.Node<\"vec4\"> | THREE.Vector4\n], THREE.JoinNode<\"vec4\">>;\nexport declare const boxFade: THREE.TSL.FnNode<[\n    THREE.Node<\"vec2\"> | THREE.Vector2,\n    THREE.Node<\"vec4\"> | THREE.Vector4,\n    THREE.Node<\"vec4\"> | THREE.Vector4\n], THREE.Node<\"float\">>;\nexport declare const rainHead: THREE.TSL.FnNode<[\n    THREE.Node<\"vec2\"> | THREE.Vector2,\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">,\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">,\n    THREE.Node<\"vec2\"> | THREE.Vector2\n], THREE.JoinNode<\"vec3\">>;\nexport declare function rainStreaks(capacity: number): THREE.Mesh<THREE.InstancedBufferGeometry, THREE.MeshBasicNodeMaterial, THREE.Object3DEventMap>;\nexport declare function rainSplashes(capacity: number): THREE.Mesh<THREE.InstancedBufferGeometry, THREE.MeshBasicNodeMaterial, THREE.Object3DEventMap>;\nexport declare const RAIN_RINGS: {\n    readonly cells: readonly [\n        0.9,\n        0.73\n    ];\n    readonly every: 0.9;\n    readonly from: 0.015;\n    readonly speed: 0.22;\n    readonly wave: 0.11;\n    readonly crests: 2.4;\n    readonly slope: 0.32;\n    readonly fade: 0.45;\n    readonly share: 0.9;\n};\nexport declare const rainRingLayer: THREE.TSL.FnNode<[\n    THREE.Node<\"vec2\"> | THREE.Vector2,\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">,\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">,\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">,\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">,\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">\n], THREE.VarNode<\"vec3\", THREE.ConstNode<\"vec3\", THREE.Vector3>>>;\nexport declare const rainRings: (p: V2, time: F, amount: F, pixel: F) => V3;\nexport declare function rainRingsWhileRaining(p: V2, time: F, pixel: F): V3;\nexport declare const WET: {\n    readonly darken: 0.42;\n    readonly rough: 0.38;\n    readonly walls: 0.55;\n    readonly film: readonly [\n        0.035,\n        0.22\n    ];\n};\nexport declare const WET_SHEEN = 0.16;\nexport declare const wetShare: (wet: F, up: F) => F;\nexport declare const wetLook: THREE.TSL.FnNode<[\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">,\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">\n], THREE.JoinNode<\"vec2\">>;\nexport declare function wetFinish(roughness: F, up: F, sheltered?: boolean): V2;\nexport declare function applyWet(material: THREE.MeshStandardNodeMaterial, { sheltered }?: {\n    sheltered?: boolean;\n}): void;\nexport {};"
        },
        {
          "file": "snow-nodes.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\ntype F = Node<'float'>;\ntype V3 = Node<'vec3'>;\nexport declare const snowUniforms: {\n    fall: THREE.UniformNode<\"float\", number>;\n    box: THREE.UniformNode<\"vec4\", THREE.Vector4>;\n    axes: THREE.UniformNode<\"vec4\", THREE.Vector4>;\n    slant: THREE.UniformNode<\"vec2\", THREE.Vector2>;\n    look: THREE.UniformNode<\"vec4\", THREE.Vector4>;\n    smear: THREE.UniformNode<\"vec3\", THREE.Vector3>;\n    colour: THREE.UniformNode<\"color\", THREE.Color>;\n    screen: THREE.UniformNode<\"vec2\", THREE.Vector2>;\n    cover: THREE.UniformNode<\"float\", number>;\n    white: THREE.UniformNode<\"float\", number>;\n};\nexport declare function snowFlakes(capacity: number): THREE.Mesh<THREE.InstancedBufferGeometry, THREE.MeshBasicNodeMaterial, THREE.Object3DEventMap>;\nexport declare const SNOW_GROUND: {\n    readonly colour: [\n        number,\n        number,\n        number\n    ];\n    readonly rough: 0.72;\n    readonly lie: [\n        number,\n        number\n    ];\n    readonly edge: 0.55;\n    readonly soft: 0.6;\n    readonly tone: 0.12;\n};\nexport declare const snowShare: THREE.TSL.FnNode<[\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">,\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">,\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">\n], THREE.Node<\"float\">>;\nexport declare const snowColour: () => V3;\nexport declare function settledSnow(up: F, sheltered?: boolean): {\n    k: F;\n    tone: F;\n};\nexport declare function applySnow(material: THREE.MeshStandardNodeMaterial, { sheltered, multiplied }?: {\n    sheltered?: boolean;\n    multiplied?: boolean;\n}): void;\nexport {};"
        },
        {
          "file": "weather.ts",
          "declarations": "export type WeatherKind = 'clear' | 'fog' | 'rain' | 'storm' | 'snow';\nexport declare const WEATHER_KINDS: readonly WeatherKind[];\nexport declare const DRAWN_KINDS: ReadonlySet<WeatherKind>;\nexport type WeatherState = {\n    fog: number;\n    rain: number;\n    storm: number;\n    snow: number;\n    wind: number;\n};\nexport declare const CLEAR: Readonly<WeatherState>;\nexport type Climate = {\n    dawnFog: number;\n    nightFog: number;\n    dayMist: number;\n    fogStrength: number;\n    burnOff: number;\n    rain: number;\n    storm: number;\n    snow: number;\n    blizzard: number;\n};\nexport declare const CLIMATE_KNOBS: Record<keyof Climate, {\n    label: string;\n    min: number;\n    max: number;\n    step: number;\n    hint: string;\n}>;\nexport declare const CLIMATES: Record<string, Climate>;\nexport declare const DEFAULT_CLIMATE: Climate;\nexport declare function climateKey(biomeId: string | null | undefined): string;\nexport declare function stormWindiness(rain: number, storm: number): number;\nexport declare function stormGust(time: number, storm: number): number;\nexport declare function worldSeed(worldId: string): number;\nexport declare function dayCalm(seed: number, day: number): number;\nexport type WeatherEvent = {\n    kind: 'dawn' | 'night' | 'mist' | 'shower' | 'storm' | 'snowfall' | 'blizzard';\n    start: number;\n    rise: number;\n    end: number;\n    fall: number;\n    level: number;\n};\nexport type FogEvent = WeatherEvent & {\n    kind: 'dawn' | 'night' | 'mist';\n};\nexport type RainEvent = WeatherEvent & {\n    kind: 'shower' | 'storm';\n};\nexport type SnowEvent = WeatherEvent & {\n    kind: 'snowfall' | 'blizzard';\n};\nexport declare const FOG_TIMING: {\n    readonly dawnRise: 1.5;\n    readonly nightRise: 2;\n    readonly mistRise: 3;\n    readonly fall: 2;\n    readonly mistLevel: 0.45;\n    readonly nightLevel: 0.9;\n};\nexport declare const RAIN_FOG = 0.8;\nexport declare const RAIN_TIMING: {\n    readonly rise: readonly [\n        0.2,\n        0.5\n    ];\n    readonly length: readonly [\n        0.4,\n        2.6\n    ];\n    readonly clear: 1.6;\n    readonly stormFrom: 13;\n    readonly stormTo: 22;\n    readonly stormRise: 0.4;\n    readonly stormLength: readonly [\n        0.9,\n        2.5\n    ];\n    readonly stormClear: 0.8;\n    readonly stormLead: 0.3;\n    readonly stormTrail: 0.5;\n    readonly pulse: 0.18;\n    readonly pulseHours: 0.55;\n};\nexport declare function wetDay(seed: number, day: number, c: Climate): {\n    rain: boolean;\n    storm: boolean;\n};\nexport declare function fogEvents(seed: number, day: number, c: Climate): FogEvent[];\nexport declare function rainEvents(seed: number, day: number, c: Climate): RainEvent[];\nexport declare const SNOW_TIMING: {\n    readonly rise: readonly [\n        0.33,\n        0.67\n    ];\n    readonly length: readonly [\n        1,\n        4\n    ];\n    readonly clear: 1.5;\n    readonly most: 0.75;\n    readonly blizzardRise: 0.5;\n    readonly blizzardLength: readonly [\n        1.5,\n        3.5\n    ];\n    readonly blizzardClear: 1;\n    readonly blizzardLevel: readonly [\n        0.92,\n        1\n    ];\n    readonly pulse: 0.12;\n    readonly pulseHours: 0.8;\n};\nexport declare function snowDay(seed: number, day: number, c: Climate): {\n    snow: boolean;\n    blizzard: boolean;\n};\nexport declare function snowEvents(seed: number, day: number, c: Climate): SnowEvent[];\nexport declare function blizzardOf(snow: number): number;\nexport declare function snowWindiness(snow: number): number;\nexport declare function eventFog(e: WeatherEvent, hours: number): number;\nexport declare function stormRain(e: RainEvent): RainEvent;\nexport declare function seededWeather(seed: number, days: number, c: Climate): WeatherState;\nexport declare function overcastOf(state: WeatherState): number;\nexport declare function snowyShare(state: WeatherState): number;\nexport declare function kindOf(state: WeatherState): WeatherKind;\nexport declare function nextSnow(seed: number, fromHours: number, c: Climate, kind?: SnowEvent['kind'], within?: number): SnowEvent | null;\nexport declare function nextMistyDawn(seed: number, from: number, c: Climate, within?: number): number | null;\nexport declare function nextRain(seed: number, fromHours: number, c: Climate, kind?: RainEvent['kind'], within?: number): RainEvent | null;\nexport declare const WETNESS: {\n    readonly soak: 8;\n    readonly dry: 0.4;\n    readonly night: 0.35;\n    readonly fill: 1.5;\n    readonly drain: 0.2;\n};\nexport type Wetness = {\n    surface: number;\n    pools: number;\n};\nexport declare function stepWetness(w: Wetness, rain: number, hours: number, hour: number): Wetness;\nexport declare function seededWetness(seed: number, days: number, c: Climate, back?: number): Wetness;\nexport declare const SNOW_COVER: {\n    readonly build: 2.8;\n    readonly least: 0.03;\n    readonly melt: 0.11;\n    readonly night: 0.25;\n};\nexport declare function stepSnowCover(cover: number, snow: number, hours: number, hour: number): number;\nexport declare function seededSnowCover(seed: number, days: number, c: Climate, back?: number): number;\nexport type ForcedWeather = {\n    kind: WeatherKind;\n    intensity: number;\n};\nexport declare function forcedState(forced: ForcedWeather): WeatherState;\nexport declare const FORCE_SECONDS = 2.5;\nexport declare class WeatherRunner {\n    readonly seed: number;\n    readonly climates: Map<string, Climate>;\n    constructor(worldId: string, climates?: ReadonlyMap<string, Climate>);\n    get forced(): ForcedWeather | null;\n    force(kind: WeatherKind, intensity: number): void;\n    follow(): void;\n    get blending(): boolean;\n    step(seconds: number): void;\n    climateOf(biomeId: string | null | undefined): Climate;\n    seeded(biomeId: string | null | undefined, days: number): WeatherState;\n    at(biomeId: string | null | undefined, days: number): WeatherState;\n    tune(biomeId: string | null, change: Partial<Climate>): void;\n}"
        },
        {
          "file": "world-clock.ts",
          "declarations": "export declare const DAY_MINUTES = 48;\nexport declare const START_HOUR = 10;\nexport declare const hourOf: (dayFraction: number) => number;\nexport declare const fractionOf: (hour: number) => number;\nexport declare function clockText(dayFraction: number): string;\nexport declare class WorldClock {\n    dayFraction: number;\n    dayMinutes: number;\n    day: number;\n    constructor(dayFraction?: number);\n    get hour(): number;\n    get waiting(): boolean;\n    advance(seconds: number): number;\n    wait(hours: number, realSeconds?: number): void;\n    waitUntil(hour: number, realSeconds?: number): void;\n    set(hour: number): void;\n    setDay(day: number): void;\n}\nexport type Daylight = {\n    toLight: {\n        x: number;\n        y: number;\n        z: number;\n    };\n    lightColor: string;\n    lightIntensity: number;\n    sky: string;\n    hemiSky: string;\n    hemiGround: string;\n    hemiIntensity: number;\n    day: number;\n    ambient: number;\n};\nexport declare const SUNRISE = 6.5, SUNSET = 19.5;\nexport declare function daylightAt(dayFraction: number): Daylight;"
        }
      ],
      "pitfalls": [
        "Place a drop by its index and a clock in whole falls, and keep the clock short (mod 1024 falls)",
        "Fix the drops to the world, not the view",
        "No fog on the streaks and flakes",
        "A roof counts only where a whole cell is under it, or rain stops in the air beside a wall",
        "Wet and snowy surfaces are a uniform branch over the material’s own colour and roughness",
        "The streaks, splashes and flakes are hidden while it is dry",
        "The uniforms and the stop field are module-wide (one weather per page), in three’s frame group",
        "Streak and flake widths are world sizes tuned for a high game camera"
      ],
      "card": "entries/rain-snow.json"
    },
    {
      "id": "ray-grid",
      "aliases": [],
      "name": "Fast rays through big meshes and many instances",
      "summary": "Picking and line of sight that stay cheap when the scene is big. A large static mesh sorts its triangles once into a grid over x and z, and a ray walks only the cells under it (a 2D DDA). A batch of instances keeps a world sphere for each, rebuilt only when the batch is written, so a ray tests a few numbers per instance instead of multiplying every matrix, and three’s own triangle test runs only for the instances it passes through. The spheres can go in a grid of their own, so a ray costs the cells under it rather than every instance. Both are drop-in replacements for `raycast`: the hits are three’s, and `firstHitOnly` stops at the nearest.",
      "category": "technique",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "calm",
      "tags": [
        "raycasting",
        "picking",
        "line of sight",
        "ray acceleration",
        "uniform grid",
        "DDA",
        "spatial hashing",
        "InstancedMesh",
        "bounding spheres",
        "first hit",
        "terrain",
        "three.js",
        "cpu",
        "no dependencies"
      ],
      "useCases": [
        "picking among thousands of instanced props, trees or stones",
        "line of sight for many agents a frame (NPCs, cameras, creatures that look around)",
        "rays against a big terrain or a merged town of walls",
        "hover highlights in a large 3D scene without frame drops",
        "placing things on the ground under the pointer",
        "sound or light occlusion tests between many points"
      ],
      "interaction": "Hover to pick · click the field to move the beacon · drag to orbit",
      "kits": [
        {
          "kit": "game",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "transform-rig",
          "why": "Picking objects in a big scene"
        },
        {
          "id": "game-cameras",
          "why": "Camera casts that pull in round walls"
        },
        {
          "id": "agent-senses",
          "why": "Line of sight for many agents"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-13",
          "gpuMs": 0.718,
          "cpuMs": 1.07,
          "cpuP95Ms": 1.795,
          "badge": "moderate",
          "drawCalls": 10,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the beacon circling, so all 32 sight lines are recast through the grids every frame (plus a few lines a frame recast each quick way in turn, and one through three’s own every 1.5 s), and a pick through the middle of the screen each frame. 4,000 stones, 40 walls and 20,000 terrain triangles."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 4.325,
          "cpuMs": 2.735,
          "cpuP95Ms": 3.445,
          "badge": "heavy",
          "drawCalls": 10,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 296 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 6.47,
          "cpuMs": 2.6,
          "cpuP95Ms": 3.32,
          "badge": "heavy",
          "drawCalls": 10,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 892 ms."
        }
      ],
      "signatures": [
        {
          "file": "instance-rays.ts",
          "declarations": "import * as THREE from 'three';\nimport { type MeshGridOptions } from './mesh-grid';\nexport type InstanceRayOptions = {\n    gridFrom?: number;\n    modelGrid?: MeshGridOptions;\n    cell?: number | 'auto';\n};\nexport type InstanceRaycast = ((raycaster: THREE.Raycaster, intersects: THREE.Intersection[]) => void) & {\n    bounds(): Float32Array;\n    refresh(): void;\n    stats(): {\n        spheres: number;\n        tested: number;\n        cells: number;\n        cell: number;\n    };\n};\nexport declare function accelerateInstanceRaycast(mesh: THREE.InstancedMesh, version: () => number, options?: InstanceRayOptions): InstanceRaycast;\nexport declare function instanceRaycast(mesh: THREE.InstancedMesh, version: () => number, options?: InstanceRayOptions): InstanceRaycast;"
        },
        {
          "file": "mesh-grid.ts",
          "declarations": "import * as THREE from 'three';\nexport type MeshGridOptions = {\n    cell?: number;\n    worth?: number;\n};\nexport type MeshGrid = {\n    cell: number;\n    minX: number;\n    minZ: number;\n    cols: number;\n    rows: number;\n    starts: Int32Array;\n    items: Int32Array;\n    triangles: number;\n    heights: Float32Array;\n    stamp: Uint32Array;\n    pass: number;\n};\nexport declare function buildMeshGrid(geometry: THREE.BufferGeometry, options?: MeshGridOptions): MeshGrid | null;\nexport declare function walkCells(grid: Pick<MeshGrid, 'cell' | 'minX' | 'minZ' | 'cols' | 'rows'>, ox: number, oz: number, dx: number, dz: number, tIn: number, tOut: number, visit: (cell: number, exit: number) => boolean | void): void;\nexport declare function accelerateRaycast(mesh: THREE.Mesh, options?: MeshGridOptions): boolean;\nexport declare const gridOf: (mesh: THREE.Mesh) => MeshGrid | null;"
        }
      ],
      "pitfalls": [
        "The mesh grid is over the mesh’s own x and z",
        "Static geometry only: the grid is built once from the positions",
        "The instance spheres are rebuilt only when `version()` changes",
        "Hits come back in the order the cells were walked, not sorted",
        "`firstHitOnly` is a property you add to the Raycaster (as three-mesh-bvh does)",
        "A cell that holds most of the mesh",
        "An array of materials, or a draw range that leaves part of the geometry out",
        "Tall vertical faces stack in one cell",
        "An instance scaled to zero is never hit (its sphere has no radius)",
        "The model grid for an instanced batch (`gridFrom`, 300 triangles) is in the model’s own units"
      ],
      "card": "entries/ray-grid.json"
    },
    {
      "id": "rd-skin",
      "aliases": [],
      "name": "A living skin the page steers",
      "summary": "A Gray–Scott reaction–diffusion culture under a page, in raw WebGPU, steered by the DOM: marked elements draw a field map every frame that sets where it grows, how (solitons, dividing spots, holes, a labyrinth or worms) and where it must not. Bars and dishes seed it, text and glass panels hold it back with a living edge, hover and focus make it surge, and a pointer paints and seeds it. Shaded as a wet, embossed tissue with a pointer lamp, and every panel drawn as glass over it. It rests when nothing changes. Without WebGPU the same runs on WebGL2.",
      "category": "surface",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "reaction-diffusion",
        "gray-scott",
        "dom + gpu",
        "steered by the dom",
        "field map",
        "raw webgpu",
        "wgsl",
        "compute",
        "storage texture",
        "ping-pong",
        "glass",
        "background",
        "charts",
        "paint",
        "timestamp queries",
        "rests when idle",
        "webgl2 fallback",
        "no dependencies"
      ],
      "useCases": [
        "a living background that keeps out from under text",
        "charts whose bars grow as tissue",
        "a dashboard that answers hover and focus",
        "glass panels framed by growth",
        "teaching pattern formation (five regimes side by side)",
        "a page you can paint on"
      ],
      "interaction": "Drag on the open tissue to paint · click to seed · hover a bar to feed it",
      "kits": [],
      "pairsWith": [
        {
          "id": "effects-switchboard",
          "why": "Let people still the culture"
        },
        {
          "id": "capability-tiers",
          "why": "A still pattern on weak GPUs"
        },
        {
          "id": "cell-membranes",
          "why": "Another living page in raw WebGPU"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-13",
          "gpuMs": 2.947,
          "cpuMs": 0.28,
          "cpuP95Ms": 0.49,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Fine cells (2 CSS px: 960 × 540 at 1920 × 1080), living growth at about 16 Gray–Scott steps a frame, a dab painted round a loop on the open tissue every frame; field, steps, surface, shading and five glass panes; timed with its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 4.325,
          "cpuMs": 0.5,
          "cpuP95Ms": 0.81,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.728,
            "p99Ms": 17.985,
            "low1Fps": 55.4
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 154 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 7.102,
          "cpuMs": 0.62,
          "cpuP95Ms": 0.76,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 1057 ms."
        }
      ],
      "signatures": [
        {
          "file": "dom-field.ts",
          "declarations": "import { PaneList, ShapeList } from './shapes';\nexport declare const FIELD_SELECTOR = \"[data-ink],[data-pane],[data-hole],[data-feed],[data-ring],[data-curve]\";\nexport type CollectOptions = {\n    now: number;\n    dt: number;\n    wipe?: number;\n    live?: boolean;\n};\nexport type DomField = {\n    collect(roots: Iterable<Element>, origin: DOMRect | {\n        left: number;\n        top: number;\n    }, options: CollectOptions): {\n        shapes: ShapeList;\n        panes: PaneList;\n    };\n    setCurve(el: Element, points: Array<[\n        number,\n        number\n    ]>): void;\n    forget(el: Element): void;\n    shapes: ShapeList;\n    panes: PaneList;\n};\nexport declare function createDomField(): DomField;"
        },
        {
          "file": "rd-skin.ts",
          "declarations": "import { type SkinColours } from './shapes';\nexport type RdSkinOptions = {\n    cellPx?: number;\n    device?: GPUDevice;\n    backend?: 'auto' | 'webgpu' | 'webgl2';\n    onError?: (message: string) => void;\n};\nexport type RdFrame = {\n    steps: number;\n    time: number;\n    pointer?: [\n        number,\n        number,\n        number,\n        number\n    ];\n    light?: [\n        number,\n        number,\n        number\n    ];\n    fx?: [\n        number,\n        number,\n        number,\n        number\n    ];\n    biome?: [\n        number,\n        number,\n        number\n    ];\n    view?: 'skin' | 'field';\n    draw?: boolean;\n};\nexport type RdSkin = {\n    device: GPUDevice | null;\n    readonly backend: 'webgpu' | 'webgl2';\n    readonly cellPx: number;\n    readonly simSize: [\n        number,\n        number\n    ];\n    resize(width: number, height: number, dpr: number): void;\n    setShapes(data: Float32Array<ArrayBuffer>, count: number): void;\n    setWells(data: Float32Array<ArrayBuffer>): void;\n    setPanes(data: Float32Array<ArrayBuffer>, count: number): void;\n    dab(x: number, y: number, radius: number, strength?: number): void;\n    ripple(x: number, y: number, strength?: number, time?: number): void;\n    reset(seedScale?: number): void;\n    theme(colours: Partial<SkinColours>): void;\n    frame(f: RdFrame): boolean;\n    gpuMs(): number | null;\n    readonly lost: boolean;\n    onLost: ((reason: string) => void) | null;\n    dispose(): void;\n};\nexport declare function createRdSkin(canvas: HTMLCanvasElement, options?: RdSkinOptions): Promise<RdSkin | null>;"
        },
        {
          "file": "shapes.ts",
          "declarations": "export declare const SHAPE_FLOATS = 16;\nexport declare const PANE_FLOATS = 20;\nexport declare const MAX_SHAPES = 1024;\nexport declare const MAX_PANES = 64;\nexport declare const MAX_WELLS = 256;\nexport declare const Kind: {\n    readonly Rect: 0;\n    readonly Circle: 1;\n    readonly Capsule: 2;\n    readonly Grid: 3;\n};\nexport type Steer = {\n    regime: number;\n    inhibit: number;\n    source: number;\n};\nexport declare const REGIMES: readonly [\n    {\n        readonly t: 0;\n        readonly name: \"Solitons\";\n        readonly note: \"lone spots that keep their distance\";\n        readonly feed: 0.03;\n        readonly kill: 0.062;\n    },\n    {\n        readonly t: 0.25;\n        readonly name: \"Mitosis\";\n        readonly note: \"spots that grow and split in two\";\n        readonly feed: 0.0367;\n        readonly kill: 0.0649;\n    },\n    {\n        readonly t: 0.5;\n        readonly name: \"Holes\";\n        readonly note: \"a sheet riddled with round holes\";\n        readonly feed: 0.039;\n        readonly kill: 0.058;\n    },\n    {\n        readonly t: 0.75;\n        readonly name: \"Labyrinth\";\n        readonly note: \"a maze of winding stripes\";\n        readonly feed: 0.0545;\n        readonly kill: 0.062;\n    },\n    {\n        readonly t: 1;\n        readonly name: \"Worms\";\n        readonly note: \"short stripes that break into dashes\";\n        readonly feed: 0.078;\n        readonly kill: 0.061;\n    }\n];\nexport declare function feedKill(t: number): {\n    feed: number;\n    kill: number;\n};\nexport declare const regimeName: (t: number) => \"Holes\" | \"Solitons\" | \"Mitosis\" | \"Labyrinth\" | \"Worms\";\nexport declare class ShapeList {\n    readonly data: Float32Array<ArrayBuffer>;\n    count: number;\n    clear(): void;\n    rect(x: number, y: number, w: number, h: number, radius: number, soft: number, alpha: number, s: Steer): boolean;\n    ring(cx: number, cy: number, outer: number, inner: number, soft: number, alpha: number, s: Steer, frac?: number): boolean;\n    capsule(x0: number, y0: number, x1: number, y1: number, half: number, soft: number, alpha: number, s: Steer): boolean;\n    grid(cx: number, cy: number, radius: number, pitchX: number, pitchY: number, cols: number, rows: number, soft: number, alpha: number, inhibit: number): boolean;\n}\nexport declare const PANE_GLASS = 0, PANE_VESSEL = 2;\nexport declare const HOLE_NONE = 0, HOLE_RECT = 1, HOLE_CIRCLE = 2, HOLE_GRID = 3, HOLE_WHOLE = 4;\nexport declare class PaneList {\n    readonly data: Float32Array<ArrayBuffer>;\n    count: number;\n    clear(): void;\n    pane(x: number, y: number, w: number, h: number, radius: number, kind: number, hover: number, visibility: number): number;\n    hole(i: number, kind: typeof HOLE_RECT | typeof HOLE_CIRCLE, x: number, y: number, w: number, h: number, radius: number): void;\n    wells(i: number, cx: number, cy: number, radius: number, pitchX: number, pitchY: number, cols: number, rows: number): void;\n}\nexport type SkinColours = Record<'sub0' | 'sub1' | 'young' | 'mature' | 'alt' | 'sss' | 'glass' | 'rim' | 'shade', [\n    number,\n    number,\n    number,\n    number\n]>;\nexport type SkinLook = {\n    colours: SkinColours;\n    iridescence: number;\n    bump: number;\n    grain: number;\n};\nexport declare const LOOKS: Record<'light' | 'dark', SkinLook>;\nexport declare const COLOUR_KEYS: readonly [\n    \"sub0\",\n    \"sub1\",\n    \"young\",\n    \"mature\",\n    \"alt\",\n    \"sss\",\n    \"glass\",\n    \"rim\",\n    \"shade\"\n];\nexport declare function stepsFor(state: {\n    acc: number;\n}, o: {\n    dt: number;\n    living: boolean;\n    age: number;\n    idle: boolean;\n    settle: number;\n    burst?: number;\n    cap?: number;\n}): number;"
        }
      ],
      "pitfalls": [
        "Mark text and controls data-ink (or put them in a data-pane)",
        "Shapes are read in DOM order and each blends over the last, so a child undoes its parent",
        "Read the rects every frame you draw (collect does)",
        "Steps are per frame, not per second",
        "A frame with no steps leaves the culture exactly as it is, queued dabs included",
        "Several dispatches in one compute pass see each other’s writes, so the steps can go in one pass",
        "Under reduced motion, grow the first settled state unseen",
        "cellPx sets the cost: 2 CSS px a cell at 1920 × 1080 is 960 × 540 cells",
        "The canvas is opaque and owns the colour of the page under the DOM",
        "A new resize stretches the old culture onto the new grid",
        "A WebGPU device can be lost (a driver reset, a sleeping laptop)",
        "The canvas is kept within the device’s largest texture (8192 px on most)",
        "Without WebGPU, createRdSkin returns the WebGL2 port"
      ],
      "card": "entries/rd-skin.json"
    },
    {
      "id": "reach-test",
      "aliases": [],
      "name": "Menu reach test",
      "summary": "A test that fails when any function in an app is more than two clicks away and has no Ctrl K command. A pure model you feed the same data your menus, panels, command list and keys are built from: it works out every function’s fewest clicks and the way there, flags the ones too deep or with no way in at all, allows a few deep on purpose with a reason, and suggests the smallest fix (move the control up into the deepest menu that keeps it in reach, or add a command), which it can apply. Also the declared form an app keeps by hand, each control’s exact text held to its source file so a rename fails the build.",
      "category": "systems",
      "role": "tooling",
      "stack": [
        "headless"
      ],
      "character": "calm",
      "tags": [
        "reachability",
        "information architecture",
        "menus",
        "command palette",
        "Ctrl K",
        "keyboard shortcuts",
        "discoverability",
        "UX test",
        "vitest",
        "feature map",
        "accessibility",
        "no dependencies"
      ],
      "useCases": [
        "keeping a growing app’s functions findable",
        "a unit test over the menus as they are defined",
        "reviewing an app’s map before a redesign",
        "deciding what goes in the command palette",
        "catching a feature added with no way in",
        "holding a hand-kept feature map to the source"
      ],
      "interaction": "Pick a ▲ function, then a fix · arrow keys walk the map · Fix all, or change the limit",
      "kits": [
        {
          "kit": "foundations",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "command-palette",
          "why": "Where the commands it requires live"
        },
        {
          "id": "keyboard-shortcuts",
          "why": "Keys count as reach"
        },
        {
          "id": "perf-gates",
          "why": "Run in the same gate"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": null,
          "cpuMs": 0.1,
          "cpuP95Ms": 0.17,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.483,
            "p99Ms": 17.97,
            "low1Fps": 54.7
          },
          "notes": "Measured with the demo fixing every function and starting over in turn, about twice a second: each time the reach test runs over 27 functions, the map is laid out again and every moved control and its line glide to their new places. Idle, nothing runs."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.195,
          "cpuP95Ms": 0.37,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 54 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.18,
          "cpuP95Ms": 0.4,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 128 ms."
        }
      ],
      "signatures": [
        {
          "file": "reach.ts",
          "declarations": "export type Control = {\n    label: string;\n    does?: string;\n    opens?: Control[];\n    cost?: number;\n};\nexport type Surface = {\n    name: string;\n    controls: Control[];\n};\nexport type Command = {\n    id: string;\n    does: string;\n    label?: string;\n};\nexport type KeyBinding = {\n    keys: string;\n    does: string;\n};\nexport type AppMap = {\n    surfaces: Surface[];\n    commands?: Command[];\n    keys?: KeyBinding[];\n};\nexport type ControlPath = number[];\nexport type Way = {\n    fn: string;\n    clicks: number | null;\n    path: string[] | null;\n    at: ControlPath | null;\n    command: Command | null;\n    key: KeyBinding | null;\n};\nexport type ReachOptions = {\n    max?: number;\n    keysCount?: boolean;\n    functions?: readonly string[];\n    allow?: Readonly<Record<string, string>>;\n};\nexport type Verdict = 'clicks' | 'command' | 'key' | 'allowed' | 'too-deep' | 'nowhere';\nexport type ReachRow = Way & {\n    ok: boolean;\n    verdict: Verdict;\n    words: string;\n};\nexport type ReachReport = {\n    rows: ReachRow[];\n    failures: ReachRow[];\n    problems: string[];\n    ok: boolean;\n};\nexport declare const pathWords: (path: readonly string[]) => string;\nexport declare function functionsIn(map: AppMap): string[];\nexport declare function waysIn(map: AppMap): Map<string, Way>;\nexport declare function controlAt(map: AppMap, at: ControlPath): Control | null;\nexport declare function checkReach(map: AppMap, o?: ReachOptions): ReachReport;\nexport type Fix = {\n    kind: 'command';\n    fn: string;\n    id: string;\n    label: string;\n    words: string;\n} | {\n    kind: 'move';\n    fn: string;\n    from: ControlPath;\n    into: ControlPath;\n    clicks: number;\n    words: string;\n};\nexport declare function commandId(map: AppMap, fn: string): string;\nexport declare function fixesFor(map: AppMap, fn: string, o?: Pick<ReachOptions, 'max'>): Fix[];\nexport declare function applyFix(map: AppMap, fix: Fix): AppMap;\nexport declare function fixAll(map: AppMap, o?: ReachOptions & {\n    prefer?: 'move' | 'command';\n}): {\n    map: AppMap;\n    applied: Fix[];\n};\nexport type Declared = {\n    fn: string;\n    surface: string;\n    file: string;\n    anchor: string;\n    clicks: number;\n    ctrlk?: string;\n};\nexport type DeclaredProblem = {\n    fn: string;\n    kind: 'duplicate' | 'anchor' | 'too-deep' | 'command';\n    words: string;\n};\nexport declare function checkDeclared(rows: readonly Declared[], o: {\n    read: (file: string) => string;\n    hasCommand: (id: string) => boolean;\n    max?: number;\n}): DeclaredProblem[];"
        }
      ],
      "pitfalls": [
        "The model checks the map you give it, not the screen",
        "Clicks count from the app as it opens, with what the function acts on already selected",
        "A submenu that opens on hover costs 0 clicks for a mouse but not for touch or a keyboard",
        "A key counts as a way in by default, as in the app this came from",
        "Allow a function deep only with a reason (a delete that can’t be undone)",
        "Moving a control up gives it its function’s name as its label",
        "fixAll applies one fix at a time and re-checks, so two fixes never fight"
      ],
      "card": "entries/reach-test.json"
    },
    {
      "id": "read-reveals",
      "aliases": [],
      "name": "Passages that reveal as you read",
      "summary": "A passage hidden under a material until the reader reaches it. A redaction bar burns away from left to right along a ragged SVG mask with a glowing edge, shedding GPU embers in step with its front; a slab of ice thaws down a ragged wet front, fresh snow in a moment and old blue ice slowly. Passages go in reading order, a beat apart, once they are in the reading band (an IntersectionObserver and a pure test), or on demand. The words are in the page, for screen readers, from the start; reduced motion and browsers without WebGPU get a fade. Seeded: a passage burns the same way every time.",
      "category": "ui",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "reveal",
        "redaction",
        "burn",
        "ice",
        "thaw",
        "scroll",
        "IntersectionObserver",
        "svg mask",
        "@property",
        "raw webgpu",
        "wgsl",
        "embers",
        "reading",
        "storytelling",
        "reduced motion",
        "seeded",
        "dom + gpu",
        "no dependencies"
      ],
      "useCases": [
        "reports, briefs and long reads that hand out their findings as you reach them",
        "spoilers, answers and punchlines held back until the reader gets there",
        "quizzes and lessons that show the answer on demand",
        "archives and changelogs where older notes feel older",
        "onboarding that reveals each step as it scrolls in"
      ],
      "interaction": "Scroll the memo: each bar burns as it comes into view, and the archive thaws · Reveal all, or Again",
      "kits": [
        {
          "kit": "product-presentation",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "voxel-dissolve",
          "why": "Elements that assemble cell by cell"
        },
        {
          "id": "stroke-font-text",
          "why": "Words drawn stroke by stroke"
        }
      ],
      "variants": [],
      "version": "1.0.2",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "motion",
          "in": "module",
          "values": {
            "strict": "fade",
            "refined": "auto",
            "playful": "full"
          }
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 0.006,
          "cpuMs": 0.13,
          "cpuP95Ms": 0.37,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.37,
            "p99Ms": 17.5,
            "low1Fps": 53.6
          },
          "notes": "Measured with the demo running itself from its first frame: every 1.8 s the passages in view are hidden and revealed again, turn about at the top of the memo (bars burning in reading order, with their embers) and at the archive (three slabs thawing). The controller is driven from the demo’s update(), so CPU time is its frame (starting passages, reading rects, the thaw) and GPU time the overlay’s pass (slabs and embers), from its timestamp queries. The bars’ masks themselves are CSS animations, outside both."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.066,
          "cpuMs": 0.15,
          "cpuP95Ms": 0.55,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.685,
            "p99Ms": 17.855,
            "low1Fps": 54.4
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 147 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 0.636,
          "cpuMs": 0.8,
          "cpuP95Ms": 2.08,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 265 ms."
        }
      ],
      "signatures": [
        {
          "file": "read-reveals.ts",
          "declarations": "import type { RevealOverlay } from './reveal-overlay';\nexport type RevealKind = 'burn' | 'ice';\nexport type RevealMotion = 'auto' | 'full' | 'fade';\nexport type ReadRevealsOptions = {\n    items: Iterable<HTMLElement>;\n    scroller?: HTMLElement | null;\n    band?: {\n        top?: number;\n        bottom?: number;\n    };\n    overlay?: RevealOverlay | null;\n    motion?: RevealMotion;\n    theme?: () => 'dark' | 'light';\n    gap?: number;\n    slow?: number;\n    auto?: boolean;\n    embers?: boolean;\n    onReveal?(el: HTMLElement, shown: number, total: number): void;\n    loop?: boolean;\n};\nexport type ReadReveals = {\n    reveal(el?: HTMLElement): void;\n    revealAll(): void;\n    reset(): void;\n    refresh(): void;\n    set(options: Partial<Pick<ReadRevealsOptions, 'motion' | 'slow' | 'auto' | 'embers' | 'gap'>>): void;\n    frame(now?: number): boolean;\n    readonly shown: number;\n    readonly total: number;\n    dispose(): void;\n};\nexport declare function createReadReveals(options: ReadRevealsOptions): ReadReveals;"
        },
        {
          "file": "reveal-overlay.ts",
          "declarations": "export type Slab = {\n    left: number;\n    top: number;\n    width: number;\n    height: number;\n    melt: number;\n    age: number;\n    seed: number;\n};\nexport type BurnOptions = {\n    dur: number;\n    density?: number;\n    heat?: number;\n    seed?: number;\n    start?: number;\n};\nexport type RevealOverlayOptions = {\n    container: HTMLElement;\n    device?: GPUDevice;\n    maxSlabs?: number;\n    maxBurns?: number;\n    dprCap?: number;\n    zIndex?: number;\n};\nexport type RevealOverlay = {\n    burn(rect: {\n        left: number;\n        top: number;\n        width: number;\n        height: number;\n    }, options: BurnOptions): number;\n    moveBurn(id: number, at: {\n        left: number;\n        top: number;\n    }): boolean;\n    draw(slabs: Slab[], now?: number): boolean;\n    busy(now?: number): boolean;\n    setTheme(theme: 'dark' | 'light'): void;\n    gpuTime(): number | null;\n    readonly maxSlabs: number;\n    readonly lost: boolean;\n    readonly canvas: HTMLCanvasElement;\n    readonly device: GPUDevice;\n    clear(): void;\n    dispose(): void;\n};\nexport declare function createRevealOverlay(options: RevealOverlayOptions): Promise<RevealOverlay | null>;"
        }
      ],
      "pitfalls": [
        "This hides nothing",
        "A bar must be one box",
        "The bar is the element’s ::before and the glowing edge its ::after while it burns",
        "Ice is drawn over the passage on the overlay canvas",
        "An ice passage’s words must sit in child elements",
        "Without WebGPU, a bar still burns (the mask and edge are CSS) but sheds no embers",
        "Bars reached together go one after another, a beat (gap) apart",
        "Masks and edges are data",
        "Forced colours drop the bars and the frost and show the words"
      ],
      "card": "entries/read-reveals.json"
    },
    {
      "id": "review-queue",
      "aliases": [],
      "name": "Review queue with a side-by-side conflict",
      "summary": "Where everything a person must look at waits, with the reason in plain words and what can be done: fix the values and write it (the rules still apply), answer a conflict, try again now, mark it handled elsewhere, or run it again (refused if it would write twice). A conflict shows the old row against the new one, with an “only differences” switch and Keep, Replace or Add as new, each saying what it does and why it can’t when it can’t. List and detail side by side, one at a time when narrow; tabs and arrow keys, focus kept across updates, status changes announced. Plain DOM; the app owns the data.",
      "category": "ui",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "review",
        "queue",
        "inbox",
        "triage",
        "conflict",
        "diff",
        "compare",
        "duplicates",
        "side by side",
        "only differences",
        "keep replace add",
        "fix values",
        "manual review",
        "ingest",
        "master detail",
        "tabs",
        "switch",
        "keyboard",
        "live region",
        "accessibility",
        "rtl",
        "dom",
        "css",
        "tested",
        "no dependencies"
      ],
      "useCases": [
        "imports, uploads and scanned documents a person must check",
        "the same record arriving twice with other values",
        "a moderation or approval queue",
        "sync conflicts shown field by field",
        "any job that waits instead of guessing"
      ],
      "interaction": "Open a receipt · answer the conflict · fix the missing date · switch the shared folder on · bring in two more",
      "kits": [],
      "pairsWith": [
        {
          "id": "field-rules",
          "why": "Why each value waits for a person"
        },
        {
          "id": "pdf-field-map",
          "why": "Where the value sits on the page"
        },
        {
          "id": "offline-sync",
          "why": "Conflicts from offline edits to answer"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 1.025,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.25,
            "p99Ms": 18.01,
            "low1Fps": 55.4
          },
          "notes": "Measured with the demo working through its own queue: every 12 frames it opens the next item (the detail is rebuilt: notes, values, history, and for the conflict the side-by-side table and its choices) and flips \"Only differences\" on the conflict. Nothing runs between those steps."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 1.72,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 61 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 3.94,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 188 ms."
        }
      ],
      "signatures": [
        {
          "file": "conflict-view.ts",
          "declarations": "import { type Cell, type Choice, type Conflict } from './review-model';\nexport type ConflictViewOptions = {\n    conflict: Conflict;\n    onlyDifferences?: boolean;\n    onChoose(choice: Choice): void | Promise<void>;\n    onToggle?(only: boolean): void;\n    format?(value: Cell, column: string, index: number): string;\n    oldLabel?: string;\n    newLabel?: string;\n    busy?: boolean;\n    headingLevel?: 2 | 3 | 4 | 5;\n};\nexport type ConflictView = {\n    el: HTMLElement;\n    update(conflict: Conflict): void;\n    setOnlyDifferences(only: boolean): void;\n    destroy(): void;\n};\nexport declare const formatCell: (v: Cell) => string;\nexport declare function conflictView(host: HTMLElement, options: ConflictViewOptions): ConflictView;"
        },
        {
          "file": "review-queue.ts",
          "declarations": "import { type ConflictViewOptions } from './conflict-view';\nimport { type ActionId, type Choice, type ItemStatus, type Note, type ReviewItem, type View } from './review-model';\nexport type ReviewAction = {\n    item: ReviewItem;\n    action: ActionId;\n    choice?: Choice;\n    values?: Record<string, string>;\n};\nexport type ReviewQueueOptions = {\n    items: ReviewItem[];\n    onAction(action: ReviewAction): void | Promise<void>;\n    validate?(item: ReviewItem, values: Record<string, string>): Note[];\n    view?: View;\n    onlyDifferences?: boolean;\n    format?: ConflictViewOptions['format'];\n    stillWritten?(item: ReviewItem): boolean;\n    label?: string;\n    onSay?(text: string): void;\n    onSelect?(item: ReviewItem | null): void;\n    formatTime?(ms: number): string;\n};\nexport type ReviewQueue = {\n    el: HTMLElement;\n    update(items: ReviewItem[]): void;\n    select(id: string | null, focus?: boolean): void;\n    setView(view: View): void;\n    readonly selected: ReviewItem | null;\n    readonly view: View;\n    readonly narrow: boolean;\n    destroy(): void;\n};\nexport declare function reviewQueue(host: HTMLElement, options: ReviewQueueOptions): ReviewQueue;\nexport type { ItemStatus };"
        }
      ],
      "pitfalls": [
        "The app owns the items: onAction changes your data, then you call update(items)",
        "A choice is final in the app’s eyes",
        "Replace needs the old row in place (conflict.row)",
        "A conflict waits while other answers write",
        "Compare only columns that carry read values (conflict.compare)",
        "Values are compared after normalising",
        "validate runs before a fix is sent",
        "Import review-queue.base.css, then review-queue.css (or your own look)",
        "The narrow view is a container query on the queue’s own width (40em), not the window’s"
      ],
      "card": "entries/review-queue.json"
    },
    {
      "id": "ring-effects",
      "aliases": [],
      "name": "Ring-buffer effects: streaks, smoke, flame, marks, spills and lightning",
      "summary": "Five effects that each live in a fixed ring of instance slots and never allocate in play: streaks along a line (darts, beams, jagged arcs with forks that stay attached as they re-form, comets, wakes that burn away from their start), lit smoke puffs that fade into the floor and part round whoever walks through them, a flame stream flown on a closed-form arc the CPU can trace, marks left on any surface (scorch that cools from white-hot, splats, cracks, skids, prints, soot that climbs a wall) and spreading liquid spills with a meniscus and ripples. The CPU writes a slot when something is made; the GPU animates it from its birth time alone; the written slots upload once a frame as one or two ranges; a draw hides when the last of it is out. Lightning bolts come down into the streak ring: three kinked runs, forks, arcs crawling from the foot and a light that follows the strokes.",
      "category": "particles",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "expressive",
      "tags": [
        "ring buffer",
        "instancing",
        "no allocation",
        "vfx",
        "streaks",
        "lightning",
        "smoke",
        "soft particles",
        "flame",
        "decals",
        "liquid",
        "closed form",
        "tsl",
        "three.js",
        "additive",
        "rests when idle"
      ],
      "useCases": [
        "sparks, beams and arcs between two points",
        "smoke columns, dust and exhaust that meet the ground softly",
        "a burner or flame jet that lands where it is aimed",
        "marks that stay: scorch, paint, prints, skids, soot",
        "pools that spread across a floor",
        "lightning in a storm, or on cue",
        "effects that must never hitch a frame"
      ],
      "interaction": "Pick an effect (keys 1 to 6) · click or tap the floor or the wall · move through low smoke · drag to orbit",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "gpu-particles",
          "why": "Bigger particle effects beside the rings"
        },
        {
          "id": "heat-haze-shockwaves",
          "why": "Haze and shockwaves at the same blasts"
        },
        {
          "id": "breakable-world",
          "why": "Dust and marks where walls break"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-13",
          "gpuMs": 0.824,
          "cpuMs": 0.3,
          "cpuP95Ms": 0.475,
          "badge": "moderate",
          "drawCalls": 11,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the show reel at a busy pace: an effect fired every 0.35 s in turn (streaks with forks, a smoke column, a flame stream and its burning spill, marks, a spreading spill, a lightning bolt), so all five rings and the bolts draw at once. About 100 to 300 puffs, 150 to 250 flame gobs and 60 streaks are alive at a time."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 5.046,
          "cpuMs": 0.91,
          "cpuP95Ms": 1.37,
          "badge": "heavy",
          "drawCalls": 11,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 3020 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 1.8,
          "cpuMs": 0.08,
          "cpuP95Ms": 0.14,
          "badge": "moderate",
          "drawCalls": 7,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 1098 ms."
        }
      ],
      "signatures": [
        {
          "file": "bolt-shape.ts",
          "declarations": "export declare const LIGHTNING: {\n    readonly slot: 9;\n    readonly chance: 0.75;\n    readonly least: 0.25;\n    readonly rise: 0.012;\n    readonly decay: 0.07;\n    readonly gap: readonly [\n        0.06,\n        0.22\n    ];\n    readonly strokes: 3;\n};\nexport declare function strikeHash(seed: number, n: number, channel: number): number;\nexport declare const strikeRoll: (seed: number, n: number) => (channel: number) => number;\nexport declare function strokesOf(roll: (channel: number) => number): {\n    at: number;\n    strength: number;\n}[];\nexport declare function strikeLight(dt: number, roll: (channel: number) => number): number;\nexport declare function lightningAt(seed: number, time: number, storm: number): number;\nexport type Strike = {\n    start: number;\n    roll: (channel: number) => number;\n};\nexport declare function strikesBetween(seed: number, from: number, to: number, storm: number): Strike[];\nexport type BoltShape = {\n    seen: number;\n    clear: number;\n    top: number;\n    lean: readonly [\n        number,\n        number\n    ];\n    drift: number;\n    forks: readonly [\n        number,\n        number\n    ];\n    fork: readonly [\n        number,\n        number\n    ];\n    joints: readonly [\n        number,\n        number\n    ];\n    kink: number;\n    crawl: readonly [\n        number,\n        number\n    ];\n    crawlLength: readonly [\n        number,\n        number\n    ];\n};\nexport declare const BOLTS: BoltShape;\nexport type Bolt = {\n    x: number;\n    y: number;\n    lean: number;\n    drift: number;\n    forks: Array<{\n        at: number;\n        angle: number;\n        length: number;\n    }>;\n    joints: Array<{\n        share: number;\n        x: number;\n        z: number;\n    }>;\n    crawl: Array<{\n        angle: number;\n        length: number;\n    }>;\n    seed: number;\n};\nexport declare function boltOf(roll: (channel: number) => number, always?: boolean, shape?: BoltShape): Bolt | null;"
        },
        {
          "file": "flame-arc.ts",
          "declarations": "export type Vec3 = {\n    x: number;\n    y: number;\n    z: number;\n};\nexport declare function gobAt(p0: Vec3, v0: Vec3, t: number, drag: number, gravity: number, buoyancy?: number, out?: Vec3): Vec3;\nexport declare function gobVelocity(v0: Vec3, t: number, drag: number, gravity: number, buoyancy?: number, out?: Vec3): Vec3;\nexport declare function gobLanding(p0: Vec3, v0: Vec3, life: number, drag: number, gravity: number, buoyancy: number, floorY: number, at?: Vec3): number;"
        },
        {
          "file": "flame-stream.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { SlotRing } from './ring';\nexport type FlameColours = {\n    core: THREE.Color;\n    flame: THREE.Color;\n    edge: THREE.Color;\n};\nexport type GobStyle = {\n    life: number;\n    size: number;\n    grow: number;\n    drag: number;\n    gravity: number;\n    buoyancy?: number;\n    colours: FlameColours;\n    brightness?: number;\n};\nexport declare const FLAME_CAPACITY = 2048;\nexport declare function flameColours(look: {\n    core: THREE.ColorRepresentation;\n    flame: THREE.ColorRepresentation;\n    edge: THREE.ColorRepresentation;\n}): FlameColours;\nexport declare const WARM_FLAME: {\n    readonly core: \"#fff3c4\";\n    readonly flame: \"#ff8a26\";\n    readonly edge: \"#b8260a\";\n};\nexport declare class FlameStream {\n    readonly object3D: THREE.Mesh;\n    readonly ring: SlotRing;\n    constructor(capacity?: number);\n    get now(): number;\n    gob(at: THREE.Vector3Like, velocity: THREE.Vector3Like, style: GobStyle, ago?: number): void;\n    update(dt: number, camera: THREE.Camera): void;\n    clear(): void;\n    dispose(): void;\n}"
        },
        {
          "file": "ring-effects.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { Decals } from './decals';\nimport { FlameStream } from './flame-stream';\nimport { LightningBolts, type BoltLook, type BoltWorld } from './lightning-bolts';\nimport { LiquidSpills } from './liquid-spill';\nimport type { BoltShape } from './bolt-shape';\nimport type { SlotRing } from './ring';\nimport { Smoke } from './smoke';\nimport { Streaks } from './streaks';\nexport type RingEffectsOptions = {\n    capacity?: {\n        streaks?: number;\n        smoke?: number;\n        flames?: number;\n        decals?: number;\n        spills?: number;\n    };\n    bolts?: BoltWorld & {\n        shape?: Partial<BoltShape>;\n        look?: Partial<BoltLook>;\n    };\n};\nexport type RingName = 'streaks' | 'smoke' | 'flames' | 'decals' | 'spills';\nexport declare class RingEffects {\n    readonly group: THREE.Group<THREE.Object3DEventMap>;\n    readonly streaks: Streaks;\n    readonly smoke: Smoke;\n    readonly flames: FlameStream;\n    readonly decals: Decals;\n    readonly spills: LiquidSpills;\n    readonly bolts: LightningBolts | null;\n    constructor(options?: RingEffectsOptions);\n    rings(): Record<RingName, SlotRing>;\n    get now(): number;\n    warm(renderer: THREE.WebGPURenderer, camera: THREE.Camera, scene: THREE.Scene): Promise<void>;\n    update(dt: number, camera: THREE.Camera): void;\n    clear(): void;\n    dispose(): void;\n}"
        }
      ],
      "pitfalls": [
        "Write instances between frames and call update(dt) before the render",
        "The ring never grows: when it is full, the newest write takes the oldest slot, alive or not",
        "Every draw is hidden while nothing in it is alive, and compileAsync skips hidden objects",
        "A batch first drawn with no instances is not a draw",
        "TSL varyings must be worked out where every kind reaches them",
        "A dead puff or gob collapses to its centre in the vertex stage",
        "Soft edges fade by height over the ground under each puff",
        "A moving streak only fades once its head lands",
        "A flame gob is let go at the end of its life, not where it hits",
        "Decals: setLimit changes how many stay and clears them",
        "The lightning light reaches what takes point lights",
        "Color.set() already converts an sRGB colour to linear"
      ],
      "card": "entries/ring-effects.json"
    },
    {
      "id": "road-network",
      "aliases": [],
      "name": "Road network, lane graph and traffic",
      "summary": "Roads as plain data (nodes, edges drawn through bends and rounded to arcs, a type on each) laid out into junctions with kerb returns and setbacks, then compiled into a lane graph: lanes on the right, connector curves through every junction with their turn, every crossing and merge between them, who gives way to whom (a side road to the main road, a left turn to oncoming traffic, signal groups), U-turns at dead ends and checks that no lane is a trap. Signals run from one clock with a per-junction offset. Routing finds the quickest way on the lanes. Traffic drives it: the Intelligent Driver Model for following, braking for curves, red and amber, stop signs, gap acceptance and keeping the junction clear, deterministic for a seed. Pure and server-runnable.",
      "category": "simulation",
      "role": "system",
      "stack": [
        "headless"
      ],
      "character": "calm",
      "tags": [
        "roads",
        "lane graph",
        "traffic",
        "junctions",
        "traffic signals",
        "give way",
        "right of way",
        "routing",
        "dijkstra",
        "intelligent driver model",
        "car following",
        "simulation",
        "deterministic",
        "canvas 2d",
        "no dependencies"
      ],
      "useCases": [
        "town traffic in a game, a city builder or a toy",
        "NPC drivers that stop at lights and give way",
        "turning a drawn road network into drivable lanes",
        "route guidance on a map: the quickest drive, keeping to the lanes",
        "teaching junction rules and traffic flow"
      ],
      "interaction": "Tap a car to follow it · [ and ] pick a car · Space pauses",
      "kits": [],
      "pairsWith": [
        {
          "id": "heightfield-chunks",
          "why": "The ground the roads are laid on"
        },
        {
          "id": "race-car",
          "why": "A car to drive the lanes"
        },
        {
          "id": "lamp-lights",
          "why": "Street lamps along the roads"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "canvas2d",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": null,
          "cpuMs": 0.345,
          "cpuP95Ms": 0.92,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 30.835,
            "p99Ms": 32.33,
            "low1Fps": 30.8
          },
          "notes": "Measured running at 20 new cars a minute on each road in (about 100 cars at once): every car decides and moves every 1/20 s of simulated time, and the frame includes the Canvas 2D drawing of the cars, lights and overlays over a cached road layer."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.5,
          "cpuP95Ms": 0.885,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 87 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.68,
          "cpuP95Ms": 1.36,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 191 ms."
        }
      ],
      "signatures": [
        {
          "file": "lanes.ts",
          "declarations": "import { type Point, type Sample } from './geometry';\nimport { type Control, type JunctionKind, type RoadNetwork, type SignalPhaseSpec } from './network';\nexport type { Control } from './network';\nexport type Turn = 'straight' | 'left' | 'right' | 'uturn';\nexport interface LaneConflict {\n    path: string;\n    kind: 'cross' | 'merge';\n    at: number;\n}\nexport interface LanePath {\n    id: string;\n    kind: 'lane' | 'connector';\n    points: Point[];\n    length: number;\n    speedKph: number;\n    next: string[];\n    edge?: string;\n    dir?: 'forward' | 'backward';\n    lane?: number;\n    spawn?: boolean;\n    exit?: boolean;\n    stop?: {\n        control: Control;\n        group: string | null;\n        junction: string;\n    };\n    junction?: string;\n    from?: string;\n    to?: string;\n    turn?: Turn;\n    group?: string | null;\n    yieldTo?: string[];\n    conflicts?: LaneConflict[];\n}\nexport interface LaneJunction {\n    id: string;\n    kind: JunctionKind;\n    centre: Point;\n    arms: Array<{\n        edge: string;\n        end: 'start' | 'end';\n        headingDeg: number;\n        control: Control;\n        group: string | null;\n        role: 'major' | 'minor' | null;\n    }>;\n    signals?: {\n        groups: Record<string, string[]>;\n        phases: SignalPhaseSpec[];\n    };\n}\nexport interface LaneGraph {\n    drivingSide: 'right';\n    paths: LanePath[];\n    junctions: LaneJunction[];\n    warnings: string[];\n}\nexport declare const LINE_BACK = 1.2;\nexport declare function buildLaneGraph(network: RoadNetwork): LaneGraph;\nexport interface Route {\n    paths: string[];\n    points: Point[];\n    length: number;\n    seconds: number;\n}\nexport declare function routeOnLanes(graph: LaneGraph, from: Point, to: Point): Route | null;\nexport type { Sample };"
        },
        {
          "file": "network.ts",
          "declarations": "import { type Point, type Sample } from './geometry';\nexport interface RoadType {\n    id: string;\n    lanes: number[];\n    carriageway: number;\n    halfWidth: number;\n    speedKph: number;\n    cornerRadius: number;\n}\nexport declare const ROAD_TYPES: Record<string, RoadType>;\nexport type NodeControl = 'auto' | 'signals' | 'give_way' | 'stop' | 'none';\nexport type Control = 'signal' | 'give_way' | 'stop' | 'priority' | 'none';\nexport interface SignalPhaseSpec {\n    seconds: number;\n    green?: string[];\n    amber?: string[];\n    allRed?: boolean;\n}\nexport interface RoadNode {\n    id: string;\n    x: number;\n    z: number;\n    control?: NodeControl;\n    phases?: SignalPhaseSpec[];\n    portal?: boolean;\n}\nexport interface RoadEdge {\n    id: string;\n    from: string;\n    to: string;\n    type: string;\n    via?: Point[];\n    radius?: number;\n}\nexport interface RoadNetwork {\n    nodes: RoadNode[];\n    edges: RoadEdge[];\n    types?: Record<string, RoadType>;\n}\nexport declare const DEFAULT_PHASES: SignalPhaseSpec[];\nexport interface Arm {\n    edge: RoadEdge;\n    end: 'start' | 'end';\n    theta: number;\n    u: Point;\n    type: RoadType;\n    setback: number;\n    control: Control;\n    group: string | null;\n    role: 'major' | 'minor' | null;\n}\nexport type JunctionKind = 'tee' | 'cross' | 'bend' | 'continuation' | 'junction';\nexport interface JunctionPlan {\n    node: RoadNode;\n    kind: JunctionKind;\n    arms: Arm[];\n    corners: Point[][];\n}\nexport interface NetworkLayout {\n    nodes: Map<string, RoadNode>;\n    types: Record<string, RoadType>;\n    samples: Map<string, Sample[]>;\n    lengths: Map<string, number>;\n    setbacks: Map<string, {\n        start: number;\n        end: number;\n    }>;\n    degree: Map<string, number>;\n    junctions: JunctionPlan[];\n    warnings: string[];\n}\nexport declare function edgeSamples(edge: RoadEdge, nodes: ReadonlyMap<string, RoadNode>, step?: number): Sample[];\nexport declare function layoutNetwork(network: RoadNetwork, step?: number): NetworkLayout;"
        },
        {
          "file": "signals.ts",
          "declarations": "import type { LaneGraph } from './lanes';\nimport type { SignalPhaseSpec } from './network';\nexport type SignalAspect = 'green' | 'amber' | 'red';\nexport type SignalApproach = string | {\n    junction: string;\n    group: string | null;\n};\nexport declare const SIGNAL_QUANTUM = 0.25;\nexport interface SignalPhase {\n    from: number;\n    seconds: number;\n    green: readonly string[];\n    amber: readonly string[];\n    allRed: boolean;\n}\nexport interface SignalSite {\n    id: string;\n    centre: {\n        x: number;\n        z: number;\n    };\n    period: number;\n    offset: number;\n    phases: readonly SignalPhase[];\n    groups: ReadonlyMap<string, readonly string[]>;\n}\nexport interface SignalModel {\n    readonly sites: readonly SignalSite[];\n    readonly warnings: readonly string[];\n    site(id: string): SignalSite | undefined;\n    phaseAt(siteId: string, t: number): {\n        index: number;\n        label: string;\n        remaining: number;\n    } | null;\n    approachAspect(approach: SignalApproach, t: number): SignalAspect | null;\n    groupAspect(siteId: string, group: string, t: number): SignalAspect | null;\n    timeToChange(approach: SignalApproach, t: number): number;\n}\nexport declare const cycleMod: (value: number, period: number) => number;\nexport declare function signalHash(id: string): number;\nexport declare function readPhases(raw: readonly SignalPhaseSpec[]): SignalPhase[];\nexport declare function phaseLabel(phase: SignalPhase): string;\nexport declare function signalModel(graph: Pick<LaneGraph, 'junctions'>, options?: {\n    offsets?: Readonly<Record<string, number>>;\n}): SignalModel;"
        },
        {
          "file": "traffic.ts",
          "declarations": "import { type LaneGraph, type LanePath } from './lanes';\nimport type { Point } from './geometry';\nimport type { SignalModel } from './signals';\nexport declare const IDM: {\n    readonly s0: 2;\n    readonly T: 1.3;\n    readonly a: 1.8;\n    readonly b: 3;\n};\nexport declare const TRAFFIC: {\n    readonly comfortBrake: 1.6;\n    readonly amberBrake: 3.5;\n    readonly lateralComfort: 2.2;\n    readonly maxBrake: 7;\n    readonly gapAccept: 4.5;\n    readonly watch: 45;\n    readonly lineMargin: 0.6;\n    readonly commit: 3;\n    readonly patience: 25;\n    readonly reroute: 30;\n};\nexport declare const TRAFFIC_STEP = 0.05;\nexport type TrafficState = 'cruise' | 'follow' | 'stop-signal' | 'give-way';\nexport declare function idmAccel(v: number, v0: number, gap: number, dv: number): number;\nexport interface Car {\n    id: number;\n    path: LanePath;\n    s: number;\n    v: number;\n    length: number;\n    width: number;\n    eager: number;\n    next: string | null;\n    state: TrafficState;\n    held: number;\n    trip: number;\n    route: string[] | null;\n    routeIndex: number;\n    look: number;\n    committed: string | null;\n    stoppedAt: string | null;\n    leader: number | null;\n}\nexport interface TrafficOptions {\n    seed?: number;\n    signals?: SignalModel | null;\n    perMinute?: number;\n    maxCars?: number;\n    trip?: [\n        number,\n        number\n    ];\n}\ninterface Track {\n    path: LanePath;\n    cum: Float64Array;\n    len: number;\n    corners: Array<[\n        number,\n        number\n    ]>;\n    cars: Car[];\n}\nexport declare class TrafficSim {\n    readonly graph: LaneGraph;\n    readonly tracks: Map<string, Track>;\n    readonly cars: Car[];\n    signals: SignalModel | null;\n    perMinute: number;\n    maxCars: number;\n    trip: [\n        number,\n        number\n    ];\n    t: number;\n    trips: number;\n    constructor(graph: LaneGraph, options?: TrafficOptions);\n    pointOn(pathId: string, s: number): {\n        x: number;\n        z: number;\n        heading: number;\n    };\n    pose(car: Car): {\n        x: number;\n        z: number;\n        heading: number;\n    };\n    clear(): void;\n    spawn(pathId?: string): Car | null;\n    addRouted(from: Point, to: Point): Car | null;\n    step(dt: number): void;\n    stats(): {\n        cars: number;\n        states: Record<TrafficState, number>;\n        meanSpeed: number;\n        trips: number;\n    };\n}\nexport {};"
        }
      ],
      "pitfalls": [
        "Arms at a junction are sorted by heading, and the straightest pair is the road through",
        "Traffic drives on the right",
        "A road too short for its junctions’ setbacks gets no lanes and a warning",
        "Rebuild the lane graph (and the traffic) when the network changes",
        "Cars are distances along paths, not bodies",
        "Without a signal model, signalled arms still have their lines, but nobody stops for red",
        "step(dt) runs whole steps of 1/20 s (`TRAFFIC_STEP`) and keeps the rest of dt for the next call",
        "A busy town fills its roads into rings of queues, each waiting on the next",
        "Coordinates are metres on the ground plane, x and z (y up)"
      ],
      "card": "entries/road-network.json"
    },
    {
      "id": "sand-charts",
      "aliases": [],
      "name": "Sand-pour charts",
      "summary": "Charts made of falling sand: page elements become glasses that fill with real grains to each value, the brim at the plan and the surplus heaped over it, in stacked layers of colour; lean one and its top spills over the lip, then it rights itself and pours back what it lost. An hourglass runs down to a goal. A falling-sand automaton on the Margolus neighbourhood in WebGPU compute, its containers rasterised from the elements each frame, its spouts counting grains on the GPU; a readback that never stalls tells the page when every grain is still, and then nothing runs at all.",
      "category": "simulation",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "falling sand",
        "cellular automaton",
        "margolus",
        "granular",
        "charts",
        "bar chart",
        "stacked",
        "plan vs actual",
        "hourglass",
        "progress",
        "dom + gpu",
        "drag to tip",
        "compute",
        "raw webgpu",
        "wgsl",
        "atomics",
        "rests when still",
        "timestamp queries",
        "reduced motion",
        "no dependencies"
      ],
      "useCases": [
        "a showpiece bar chart against a plan or target",
        "stacked parts of a value as layers of sand",
        "progress to a goal as an hourglass",
        "a dashboard figure people can play with",
        "surplus and shortfall made physical",
        "falling sand in any container shape over a page"
      ],
      "interaction": "Drag a glass sideways to tip it · arrows choose, Shift + arrow tips, Space taps · Months or Quarters · Table",
      "kits": [],
      "pairsWith": [
        {
          "id": "chart-access",
          "why": "The values as a table"
        },
        {
          "id": "quiet-charts",
          "why": "Plain charts beside the glasses"
        },
        {
          "id": "gauges-rings",
          "why": "Gauges for the same targets"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 1.705,
          "cpuMs": 0.325,
          "cpuP95Ms": 0.525,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.35,
            "p99Ms": 17.875,
            "low1Fps": 54.3
          },
          "notes": "Twelve glasses and the hourglass on a 2 px grid (about 540 × 290 cells at 1920 × 1080 with the dock). Measured while busy: every 2.5 s a glass is tipped in turn and every fourth time all pour again, so most frames step the automaton (16 to 18 Margolus steps with count and decide) and draw; at rest a frame costs nothing. Timed with its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 2.294,
          "cpuMs": 0.413,
          "cpuP95Ms": 0.725,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.65,
            "p99Ms": 17.91,
            "low1Fps": 50.9
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 423 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 3.552,
          "cpuMs": 0.18,
          "cpuP95Ms": 0.3,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 390 ms."
        }
      ],
      "signatures": [
        {
          "file": "layout.ts",
          "declarations": "export type Box = {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n};\nexport declare const SHAPE_FLOATS = 16;\nexport declare const REGION_FLOATS = 8;\nexport declare const MODE: {\n    readonly COUNTED: 1;\n    readonly POUR: 2;\n};\nexport declare const NEVER = 1000000000;\nexport type GlassGeometry = {\n    cx: number;\n    cy: number;\n    hx: number;\n    hy: number;\n    wall: number;\n    pivot: [\n        number,\n        number\n    ];\n    spout: [\n        number,\n        number,\n        number,\n        number\n    ];\n    capacity: number;\n};\nexport declare const spoutRise: (hx: number) => number;\nexport declare const spoutRoom: (glassWidth: number, cell: number, wall?: number) => number;\nexport declare function glassGeometry(box: Box, cell: number, wall?: number, level?: boolean): GlassGeometry;\nexport declare function glassRecord(g: GlassGeometry, o: {\n    angle: number;\n    prev?: number;\n    region: number;\n    hover?: boolean;\n    chosen?: boolean;\n}): number[];\nexport declare function hgWidth(t: number, hx: number, neck: number): number;\nexport type HourglassGeometry = {\n    cx: number;\n    cy: number;\n    hx: number;\n    hy: number;\n    neck: number;\n    wall: number;\n    upper: number;\n    lower: number;\n    grains: number;\n};\nexport declare function hourglassGeometry(box: Box, cell: number, wall?: number, neck?: number): HourglassGeometry;\nexport declare function hourglassRecord(h: HourglassGeometry, upperRegion: number, lowerRegion: number): number[];\nexport declare function floorRecord(box: Box, cell: number, overhang?: number): number[];\nexport declare function grainsFor(value: number, capacity: number, grains: number): number;\nexport declare function pourLimit(g: GlassGeometry): number;\nexport declare function pourTarget(value: number, capacity: number, g: GlassGeometry): number;\nexport declare const doneShare: (d: number) => number;\nexport declare function strataEdges(layers: readonly number[] | undefined, capacity: number, grains: number): [\n    number,\n    number\n];\nexport declare function glassRegion(o: {\n    target: number;\n    edges: [\n        number,\n        number\n    ];\n    sand: number;\n    pour: boolean;\n    epoch: number;\n    resync: number;\n}): number[];\nexport declare function hourglassRegions(o: {\n    grains: number;\n    left: number;\n    filling: boolean;\n    sand: number;\n}): {\n    upper: number[];\n    lower: number[];\n    top: number;\n};\nexport declare function spoutDue(step: number, x: number, chance: number): boolean;\nexport declare function leanLimit(slotWidth: number, glassWidth: number, glassHeight: number, share?: number, max?: number): number;\nexport type Lean = {\n    angle: number;\n    vel: number;\n    target: number;\n    limit: number;\n    spilled: boolean;\n    still: number;\n    resync: number;\n};\nexport declare const newLean: (limit?: number) => Lean;\nexport declare function stepLean(s: Lean, dt: number, motion: boolean, held?: boolean): 'spilled' | 'refill' | null;\nexport declare function createRestGate(quiet?: number): {\n    kick(frame: number): void;\n    report(frame: number, moved: number): void;\n    readonly resting: boolean;\n};"
        },
        {
          "file": "sand-charts.ts",
          "declarations": "type RGB = readonly [\n    number,\n    number,\n    number\n];\nexport type SandLook = {\n    glass: RGB;\n    glassAlpha: number;\n    line: RGB;\n    lineAlpha: number;\n    shine: RGB;\n    shineStrength: number;\n    accent: RGB;\n    accentStrength: number;\n    metal: RGB;\n    metalAlpha: number;\n    sand: RGB[];\n    grain?: {\n        lift: number;\n        shade: number;\n        bead: number;\n        glint: number;\n    };\n};\nexport type GlassValue = {\n    value: number;\n    capacity: number;\n    layers?: readonly number[];\n    sand?: number;\n};\nexport type GlassOptions = {\n    slot?: HTMLElement;\n    limit?: number;\n};\nexport type GlassHandle = {\n    readonly el: HTMLElement;\n    readonly kind: 'glass';\n    set(value: GlassValue): void;\n    lean(angle: number, held?: boolean): void;\n    leanBy(dx: number): void;\n    tip(side: -1 | 1, seconds?: number): void;\n    nudge(): void;\n    chosen: boolean;\n    hover: boolean;\n    readonly angle: number;\n    readonly limit: number;\n    readonly grains: {\n        target: number;\n        inside: number | null;\n    };\n};\nexport type HourglassHandle = {\n    readonly el: HTMLElement;\n    readonly kind: 'hourglass';\n    set(done: number): void;\n};\nexport type FloorHandle = {\n    readonly el: HTMLElement;\n    readonly kind: 'floor';\n};\nexport type SandHandle = GlassHandle | HourglassHandle | FloorHandle;\nexport type SandState = 'pouring' | 'settling' | 'rest';\nexport type SandChartsOptions = {\n    look: SandLook;\n    cell?: number;\n    speed?: number;\n    glints?: boolean;\n    level?: boolean;\n    reducedMotion?: boolean;\n    device?: GPUDevice;\n    onError?: (message: string) => void;\n    onState?: (state: SandState, blank: boolean) => void;\n    onSpill?: (glass: GlassHandle, what: 'spilled' | 'refill') => void;\n    onLost?: (reason: string) => void;\n};\nexport type SandCharts = {\n    readonly device: GPUDevice;\n    glass(el: HTMLElement, value: GlassValue, options?: GlassOptions): GlassHandle;\n    hourglass(el: HTMLElement, done: number, options?: {\n        sand?: number;\n    }): HourglassHandle;\n    floor(el: HTMLElement): FloorHandle;\n    remove(handle: SandHandle): void;\n    layout(): void;\n    pourAgain(stagger?: number): void;\n    settle(): void;\n    configure(options: Partial<Pick<SandChartsOptions, 'look' | 'cell' | 'speed' | 'glints' | 'level' | 'reducedMotion'>>): void;\n    frame(dt: number): boolean;\n    readonly state: SandState;\n    readonly blank: boolean;\n    readonly lost: boolean;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare function createSandCharts(canvas: HTMLCanvasElement, options: SandChartsOptions): Promise<SandCharts | null>;\nexport {};"
        }
      ],
      "pitfalls": [
        "A grain is a cell: the sand counts exactly",
        "Random rain doesn’t lie level",
        "A band one cell thick (a drain along a floor) can fall between cell centres and hold no cells…",
        "Grains don’t follow a glass that moves",
        "A value over the capacity heaps above the brim, at most a cone as tall as half the glass is wide",
        "Lean a glass only into the gap beside it (leanLimit, 80% of the way to its neighbour)",
        "Without carrying the sand, a leaned glass slides under its own heap and spills on the wrong side",
        "Rest only on what the GPU says, and only after two quiet reports taken after the last change",
        "An hourglass’s upper bulb never fills to its nominal grains",
        "Shelves go in the shape list before the glasses, and a shelf’s sink never replaces a wall",
        "Changing the colour layers of a glass that is already full empties it and pours again",
        "Several frames sent before one submit share the last uniform written",
        "A WebGPU device can be lost (a driver reset, a sleeping laptop, another tab’s crash)",
        "Reduced motion: pours, refills and a glass righting itself settle at full speed without being…",
        "The canvas covers the elements and takes no pointer (pointer-events: none)"
      ],
      "card": "entries/sand-charts.json"
    },
    {
      "id": "sankey-flows",
      "aliases": [],
      "name": "Sankey flows with few crossings",
      "summary": "A Sankey diagram that keeps its flows readable: barycentre sweeps keep the column order with the fewest crossings (counted, not guessed), node heights relax so bands run straight, and links are ordered at each node so no X forms at a split. Drawn as SVG bands blending from source to target colour, with a path lit on hover or focus, keyboard travel along the flow, every stop said in words, the flows as a table for screen readers, and optional particles streaming along each band at its flow’s rate. Restyle it through its parts.",
      "category": "data",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "svg",
        "sankey",
        "flow diagram",
        "crossing minimisation",
        "barycentre",
        "layered graph",
        "gradients",
        "particles",
        "accessibility",
        "keyboard",
        "no dependencies"
      ],
      "useCases": [
        "energy and material flows",
        "budgets: income to spending",
        "website and funnel journeys",
        "migrations and transfers between groups",
        "where time or money goes in a report",
        "any staged breakdown of a total"
      ],
      "interaction": "Hover or tap a band or node to light its path · Tab in and travel with the arrow keys · toggle the layout steps",
      "kits": [
        {
          "kit": "dashboard",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "chart-access",
          "why": "The flows as a table"
        },
        {
          "id": "attribution-garden",
          "why": "The same journeys as a garden"
        },
        {
          "id": "quiet-charts",
          "why": "The totals as plain charts"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "motion",
          "in": "module",
          "values": {
            "strict": false,
            "playful": true
          },
          "note": "slides and moving particles"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 3.6,
          "cpuP95Ms": 4.65,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured while the flows change every frame: each frame shuffles the input order and lays the chart out again (barycentre sweeps with a crossing count after each, relaxation, link order), rebuilding the SVG, moving to the next set of flows every 40 frames, particles on. The demo’s four-step readout (four more layouts) is counted once a set, not every frame. Idle, only the particles’ CSS animation runs."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 9.775,
          "cpuP95Ms": 12.77,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 67 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 5.76,
          "cpuP95Ms": 6.94,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 55 ms."
        }
      ],
      "signatures": [
        {
          "file": "flows.ts",
          "declarations": "import type { SankeyIn, SankeyLayout } from './sankey';\nexport type FlowNode = {\n    id: string;\n    label: string;\n    col?: number;\n    colour?: string;\n};\nexport type FlowLink = {\n    from: string;\n    to: string;\n    value: number;\n};\nexport type FlowData = {\n    nodes: readonly FlowNode[];\n    links: readonly FlowLink[];\n};\nexport type GraphLink = {\n    from: number;\n    to: number;\n    value: number;\n    source: number;\n};\nexport type Graph = {\n    nodes: readonly FlowNode[];\n    links: GraphLink[];\n    col: number[];\n    cols: number;\n    inSum: number[];\n    outSum: number[];\n    amount: number[];\n    into: number[][];\n    outOf: number[][];\n    dropped: FlowLink[];\n};\nexport declare function flowGraph(data: FlowData): Graph;\nexport declare function toSankeyIn(g: Graph): SankeyIn;\nexport type Target = {\n    kind: 'node';\n    i: number;\n} | {\n    kind: 'link';\n    i: number;\n    via?: 'out' | 'in';\n};\nexport declare function trace(g: Graph, t: Target): {\n    nodes: Set<number>;\n    links: Set<number>;\n};\nexport type Move = 'downstream' | 'upstream' | 'next' | 'prev' | 'first' | 'last';\nexport declare function travel(g: Graph, lay: SankeyLayout, at: Target | null, move: Move): Target | null;\nexport declare function nodeWords(g: Graph, i: number, words: (v: number) => string): string;\nexport declare function linkWords(g: Graph, i: number, words: (v: number) => string): string;\nexport declare function flowRows(g: Graph): Array<{\n    from: string;\n    to: string;\n    value: number;\n    ofFrom: number;\n    ofTo: number;\n}>;\nexport type Band = {\n    x0: number;\n    x1: number;\n    y0: number;\n    y1: number;\n    th: number;\n};\nexport declare function bandPath(b: Band): string;\nexport declare function lanePath(b: Band, lane?: number): string;\nexport declare function particleLanes(th: number, rate: number): {\n    lanes: Array<{\n        lane: number;\n        phase: number;\n    }>;\n    r: number;\n    speed: number;\n};\nexport declare function fitText(text: string, max: number, measure: (s: string) => number): string;"
        },
        {
          "file": "sankey-chart.ts",
          "declarations": "import { type SankeyLayout } from './sankey';\nimport { type FlowData, type Graph, type Target } from './flows';\nexport type ColourMode = 'blend' | 'source' | 'target';\nexport type SankeyChartOptions = {\n    data: FlowData;\n    title: string;\n    format?: (v: number) => string;\n    words?: (v: number) => string;\n    colour?: ColourMode;\n    optimise?: boolean;\n    straighten?: boolean;\n    orderLinks?: boolean;\n    particles?: boolean;\n    nodeWidth?: number;\n    gap?: number;\n    motion?: boolean;\n    onLayout?: (info: {\n        crossings: number;\n        graph: Graph;\n        layout: SankeyLayout;\n    }) => void;\n    renderTip?: (tip: HTMLElement, target: Target, graph: Graph) => void;\n};\nexport type SankeyChart = {\n    update(next: Partial<SankeyChartOptions>): void;\n    readonly crossings: number;\n    crossingsWith(o: Partial<Pick<SankeyChartOptions, 'optimise' | 'straighten' | 'orderLinks'>>): number;\n    highlight(id: string | null): void;\n    dispose(): void;\n};\nexport declare function createSankey(host: HTMLElement, options: SankeyChartOptions): SankeyChart;"
        },
        {
          "file": "sankey.ts",
          "declarations": "export type SankeyIn = {\n    nodes: readonly {\n        col: number;\n        amount: number;\n        y?: number;\n    }[];\n    links: readonly {\n        from: number;\n        to: number;\n        amount: number;\n    }[];\n};\nexport type SankeyLayout = {\n    nodes: {\n        x: number;\n        y: number;\n        h: number;\n    }[];\n    links: {\n        y0: number;\n        y1: number;\n        th: number;\n    }[];\n    order: number[][];\n    k: number;\n};\nexport type SankeyOptions = {\n    nodeW: number;\n    pad: number;\n    sweeps?: number;\n    transpose?: number;\n    relax?: number;\n    ordered?: boolean;\n};\nexport declare function sankeyLayout(flow: SankeyIn, opts: SankeyOptions): SankeyLayout;\nexport declare function crossingsOf(lay: Omit<SankeyLayout, 'order' | 'k'>, links: SankeyIn['links'], nodes: SankeyIn['nodes'], nodeW: number): number;"
        }
      ],
      "pitfalls": [
        "Import sankey.base.css before sankey.css",
        "Flows must not loop: a link that closes a cycle",
        "Give the host a height: the chart fills its box and redraws at a new size (a ResizeObserver)",
        "A node’s size is the larger of what flows in and out",
        "Crossing counts grow with the square of the links (each pair is sampled 33 times)",
        "Colour follows the node, not its rank",
        "The particles are a CSS animation on dashed strokes",
        "The figure is one Tab stop with role=\"application\" so the arrow keys reach it under a screen…",
        "Labels are cut to the room before the next column and hidden where they would overlap a bigger…"
      ],
      "card": "entries/sankey-flows.json"
    },
    {
      "id": "sdf-text",
      "aliases": [],
      "name": "SDF text at any zoom",
      "summary": "Crisp text at 2% or 6400%: glyphs rasterised on first use with Canvas 2D, turned into signed distance fields by an exact distance transform, packed into one growing atlas, laid out with kerning and wrapping that matches the DOM, and drawn in one instanced pass.",
      "category": "canvas",
      "role": "system",
      "stack": [
        "three",
        "dom"
      ],
      "character": "calm",
      "tags": [
        "text",
        "sdf",
        "glyph atlas",
        "distance transform",
        "kerning",
        "layout",
        "instancing",
        "tsl"
      ],
      "useCases": [
        "text on zoomable boards",
        "labels in 3D scenes and maps",
        "sticky notes that fit their text",
        "thousands of labels in one draw",
        "editors that must wrap like the DOM"
      ],
      "interaction": "Click, then scroll to zoom · drag to pan · edit the paragraph in the box",
      "kits": [],
      "pairsWith": [
        {
          "id": "infinite-canvas",
          "why": "Crisp labels on a zoomable board"
        },
        {
          "id": "weight-glyphs",
          "why": "Weights mixed from one distance field"
        },
        {
          "id": "world-pinned-labels",
          "why": "HTML labels where text must be selectable"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.80",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-03",
          "gpuMs": 0.091,
          "cpuMs": 0.405,
          "cpuP95Ms": 0.54,
          "badge": "light",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured while the board zooms slowly in and out over about 900 glyphs (one instanced draw)."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.393,
          "cpuMs": 0.98,
          "cpuP95Ms": 1.315,
          "badge": "moderate",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 225 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 1.665,
          "cpuMs": 0.34,
          "cpuP95Ms": 0.72,
          "badge": "moderate",
          "drawCalls": 4,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 210 ms."
        }
      ],
      "signatures": [
        {
          "file": "atlas.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { FontMetrics } from './layout';\nexport declare const FONT_FAMILY = \"\\\"Inter Variable\\\"\";\nexport declare const FONT_WEIGHT = 450;\nexport declare const RASTER = 48;\nexport type FontSpec = {\n    family: string;\n    weight: number;\n    style?: 'italic';\n};\nexport type Glyph = {\n    u: number;\n    v: number;\n    w: number;\n    h: number;\n    ox: number;\n    oy: number;\n};\nexport declare class GlyphFace {\n    readonly spec: FontSpec;\n    readonly metrics: FontMetrics;\n    readonly ctx: CanvasRenderingContext2D;\n    constructor(spec: FontSpec, atlas: GlyphAtlas);\n    glyph(ch: string): Glyph | null;\n}\nexport declare class GlyphAtlas {\n    size: number;\n    texture: THREE.DataTexture;\n    readonly base: GlyphFace;\n    readonly growListeners: Set<(texture: THREE.DataTexture) => void>;\n    static create(): Promise<GlyphAtlas>;\n    get metrics(): FontMetrics;\n    glyph(ch: string): Glyph | null;\n    face(spec: FontSpec): GlyphFace;\n    flush(): void;\n    dispose(): void;\n    draw(ctx: CanvasRenderingContext2D, ch: string): Glyph | null;\n}"
        },
        {
          "file": "glyph-text.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { type GlyphAtlas, type GlyphFace } from './atlas';\nimport type { PlacedGlyph } from './layout';\nexport type GlyphRun = {\n    glyphs: readonly PlacedGlyph[];\n    face: GlyphFace;\n    fontSize: number;\n    colour: THREE.ColorRepresentation;\n    x?: number;\n    y?: number;\n};\nexport declare class GlyphText {\n    readonly mesh: THREE.Mesh;\n    constructor(atlas: GlyphAtlas, capacity?: number);\n    set(runs: readonly GlyphRun[]): number;\n    dispose(): void;\n}"
        },
        {
          "file": "layout.ts",
          "declarations": "export declare const LINE_HEIGHT = 1.3;\nexport type FontMetrics = {\n    advance(ch: string): number;\n    kern(a: string, b: string): number;\n    ascent: number;\n    descent: number;\n};\nexport type PlacedGlyph = {\n    ch: string;\n    x: number;\n    y: number;\n    line: number;\n};\nexport type TextLayout = {\n    glyphs: PlacedGlyph[];\n    lineWidths: number[];\n    width: number;\n    height: number;\n    fontSize: number;\n    brokeWords: boolean;\n};\nexport declare function layoutText(text: string, fontSize: number, maxWidth: number | null, m: FontMetrics): TextLayout;\nexport declare function alignLayout(layout: TextLayout, box: {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n}, align: 'left' | 'center', valign: 'top' | 'middle'): PlacedGlyph[];\nexport declare const STICKY_SIZES: number[];\nexport declare const STICKY_PAD = 16;\nexport declare function fitSticky(text: string, w: number, h: number, m: FontMetrics): TextLayout;\nexport declare function stickyInner(w: number, h: number): {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n};"
        }
      ],
      "pitfalls": [
        "Load the font before making the atlas (document.fonts.load)",
        "The atlas doubles when it fills",
        "Coverage from the field’s screen derivative (fwidth) gives one-pixel edges at any zoom",
        "Partly covered pixels sit between the inside and outside transforms",
        "The quad is the bitmap plus a 6 px buffer",
        "Wrapping matches the DOM only with the same font, weight, kerning (normal) and line height"
      ],
      "card": "entries/sdf-text.json"
    },
    {
      "id": "sealed-relay",
      "aliases": [],
      "name": "End-to-end encrypted collaboration relay",
      "summary": "End-to-end encrypted live collaboration over a relay that can’t read. Every message is sealed with AES-GCM, every change from an edit link is signed with ECDSA, and the keys travel only in the link, after the #, which browsers never send to a server. A view link reads and shows itself but can’t change anything; a tampered message can’t be opened, a forged one is refused, a replayed one is dropped. Seals any update bytes the app gives (Yjs, or the small last-write-wins list included), with Web Crypto only. The relay’s room logic, an in-memory network for tests and rehearsals, a Node relay with no packages that serves the app over HTTPS on a local network, and a Cloudflare adapter.",
      "category": "systems",
      "role": "system",
      "stack": [
        "headless"
      ],
      "character": "calm",
      "tags": [
        "end-to-end encryption",
        "E2EE",
        "AES-GCM",
        "ECDSA",
        "P-256",
        "Web Crypto",
        "crypto.subtle",
        "signatures",
        "read-only link",
        "share link",
        "URL fragment",
        "relay",
        "WebSocket",
        "live collaboration",
        "presence",
        "replay protection",
        "padding",
        "CRDT",
        "last write wins",
        "Yjs",
        "self-signed certificate",
        "Cloudflare Workers",
        "Durable Objects",
        "live region",
        "accessibility",
        "keyboard",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "sharing a live board or document by link, with nothing readable on the server",
        "a read-only link that can watch but never change",
        "collaboration on a local network with no cloud",
        "a relay or server you don’t have to trust",
        "rehearsing a sync protocol without a network",
        "testing that tampered, forged and replayed messages are refused"
      ],
      "interaction": "Tick or rename a line in A and watch it cross the relay as noise · try a forged edit, a tampered message or a replay",
      "kits": [],
      "pairsWith": [
        {
          "id": "offline-sync",
          "why": "Edits queued offline, sealed when sent"
        },
        {
          "id": "comments-tasks",
          "why": "Live threads end to end encrypted"
        },
        {
          "id": "version-history",
          "why": "Copies kept on the device"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.695,
            "p99Ms": 24.66,
            "low1Fps": 36.8
          },
          "notes": "Measured with the demo running its three attacks in a loop at a 60 ms network delay: real AES-GCM sealing and ECDSA signing and checking in the page for every message, a forged edit, a tampered message and a replay refused, presence every 3 s, and both lists re-rendering on every change. Outside the bench, only the presence heartbeat runs between changes."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 58 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 127 ms."
        }
      ],
      "signatures": [
        {
          "file": "browser.ts",
          "declarations": "import type { Transport } from './session';\nexport declare function webSocketTransport(url: string | (() => string)): Transport;\nexport declare function relayUrl(room: string, loc?: Pick<Location, 'hostname' | 'host' | 'protocol'>, port?: number, path?: string): string;\nexport declare function secureContext(): {\n    ok: true;\n} | {\n    ok: false;\n    why: string;\n};"
        },
        {
          "file": "keys.ts",
          "declarations": "export type LiveKeys = {\n    room: string;\n    seal: CryptoKey;\n    sign: CryptoKey | null;\n    check: CryptoKey;\n    canEdit: boolean;\n};\nexport type LinkParts = {\n    room: string;\n    k: string;\n    e?: string;\n    p?: string;\n};\nexport declare function b64u(bytes: Uint8Array): string;\nexport declare const fromB64u: (s: string) => Uint8Array;\nexport declare function newSession(): Promise<{\n    keys: LiveKeys;\n    edit: LinkParts;\n    view: LinkParts;\n}>;\nexport declare function viewLink(edit: LinkParts): LinkParts;\nexport declare function keysOf(parts: LinkParts): Promise<LiveKeys>;\nexport declare const linkHash: (p: LinkParts, route?: string) => string;\nexport declare function parseLink(hash: string, route?: string): LinkParts | null;\nexport declare function seal(keys: Pick<LiveKeys, 'seal'>, plain: Uint8Array): Promise<Uint8Array>;\nexport declare function unseal(keys: Pick<LiveKeys, 'seal'>, sealed: Uint8Array): Promise<Uint8Array | null>;\nexport declare function signBytes(keys: Pick<LiveKeys, 'sign'>, bytes: Uint8Array): Promise<Uint8Array>;\nexport declare function checkBytes(keys: Pick<LiveKeys, 'check'>, bytes: Uint8Array, signature: Uint8Array): Promise<boolean>;"
        },
        {
          "file": "loopback.ts",
          "declarations": "import type { Relay } from './relay';\nimport { type Timers, type Transport } from './session';\nexport type WireEvent = {\n    type: 'send';\n    id: number;\n    link: string;\n    dir: 'up' | 'down';\n    data: Uint8Array;\n    ms: number;\n    injected?: boolean;\n} | {\n    type: 'arrive';\n    id: number;\n} | {\n    type: 'lost';\n    id: number;\n} | {\n    type: 'link';\n    link: string;\n    online: boolean;\n};\nexport type LoopLink = {\n    readonly name: string;\n    readonly room: string;\n    readonly transport: Transport;\n    setOnline(on: boolean): void;\n    send(data: Uint8Array): boolean;\n    readonly online: boolean;\n    readonly connected: boolean;\n};\nexport declare function createLoopback(o: {\n    relay: Pick<Relay, 'join'>;\n    latency?: number;\n    timers?: Timers;\n    on?: (e: WireEvent) => void;\n}): {\n    link: (name: string, room: string) => LoopLink;\n    inject(room: string, data: Uint8Array, to?: string[]): void;\n    setLatency(ms: number): void;\n};\nexport type Loopback = ReturnType<typeof createLoopback>;"
        },
        {
          "file": "lww-list.ts",
          "declarations": "export type Value = string | number | boolean | null;\nexport type Fields = Record<string, Value>;\nexport type Write = [\n    id: string,\n    field: string,\n    value: Value,\n    clock: number,\n    by: string\n];\nexport type ListItem = Fields & {\n    id: string;\n};\nexport declare const MAX_JUMP: number;\nexport declare const MAX_CLOCK: number;\nexport declare const encodeWrites: (writes: Write[]) => Uint8Array;\nexport declare function decodeWrites(bytes: Uint8Array): Write[];\nexport declare function createLwwList(writer: string): {\n    writer: string;\n    set(id: string, fields: Fields): Uint8Array;\n    apply(bytes: Uint8Array): string[];\n    state(): Uint8Array;\n    get: (id: string) => ListItem | null;\n    items(): ListItem[];\n    clock: () => number;\n};\nexport type LwwList = ReturnType<typeof createLwwList>;"
        },
        {
          "file": "relay.ts",
          "declarations": "export declare const ROOM_PATTERN: RegExp;\nexport declare const isRoom: (room: string) => boolean;\nexport type RelaySocket = {\n    send(data: Uint8Array): void;\n    close(code?: number, reason?: string): void;\n};\nexport type RelayEvent = {\n    type: 'join';\n    room: string;\n    socket: RelaySocket;\n    size: number;\n} | {\n    type: 'leave';\n    room: string;\n    socket: RelaySocket;\n    size: number;\n} | {\n    type: 'pass';\n    room: string;\n    from: RelaySocket;\n    data: Uint8Array;\n    to: number;\n} | {\n    type: 'refuse';\n    room: string;\n    reason: 'bad room' | 'room full' | 'too big' | 'too fast';\n};\nexport type RelayOptions = {\n    maxMessage?: number;\n    maxPeers?: number;\n    rate?: {\n        burst: number;\n        perSecond: number;\n    };\n    now?: () => number;\n    on?(e: RelayEvent): void;\n};\nexport type RelayMember = {\n    message(data: Uint8Array): void;\n    leave(): void;\n};\nexport declare function createRelay(o?: RelayOptions): {\n    join: (room: string, socket: RelaySocket) => RelayMember | null;\n    size: (room: string) => number;\n    rooms: () => string[];\n};\nexport type Relay = ReturnType<typeof createRelay>;"
        },
        {
          "file": "session.ts",
          "declarations": "import { type LiveKeys } from './keys';\nexport type Kind = 'hello' | 'state' | 'update' | 'aware' | 'bye';\nexport type SocketHandlers = {\n    open(): void;\n    message(data: Uint8Array): void;\n    close(): void;\n};\nexport type Socket = {\n    send(data: Uint8Array): void;\n    close(): void;\n};\nexport type Transport = {\n    open(handlers: SocketHandlers): Socket;\n};\nexport type Timers = {\n    set(fn: () => void, ms: number): unknown;\n    clear(handle: unknown): void;\n};\nexport declare const realTimers: Timers;\nexport type Presence<P> = {\n    peer: string;\n    name: string;\n    colour: string;\n    canEdit: boolean;\n    data: P | null;\n    seen: number;\n};\nexport type Status = 'idle' | 'connecting' | 'live' | 'closed';\nexport type DropReason = 'unreadable' | 'malformed' | 'unsigned' | 'bad-signature' | 'replayed';\nexport type SessionEvent = {\n    type: 'status';\n    status: Status;\n} | {\n    type: 'sent';\n    kind: Kind;\n    size: number;\n} | {\n    type: 'took';\n    kind: Kind;\n    from: string;\n    signed: boolean;\n    size: number;\n    data: Uint8Array;\n} | {\n    type: 'dropped';\n    reason: DropReason;\n    kind?: Kind;\n    from?: string;\n    size: number;\n    data: Uint8Array;\n} | {\n    type: 'joined';\n    peer: string;\n} | {\n    type: 'left';\n    peer: string;\n};\nexport type SessionOptions<P> = {\n    keys: LiveKeys;\n    transport: Transport;\n    name: string;\n    colour?: string;\n    apply(update: Uint8Array, info: {\n        from: string;\n        whole: boolean;\n    }): void;\n    state?(): Uint8Array | null;\n    presence?(raw: unknown): P | null;\n    pad?: number;\n    aware?: number;\n    gone?: number;\n    retry?: number;\n    timers?: Timers;\n    now?: () => number;\n    peer?: string;\n    on?(e: SessionEvent): void;\n};\nexport type SealedSession<P> = {\n    readonly peer: string;\n    readonly colour: string;\n    readonly canEdit: boolean;\n    readonly status: Status;\n    readonly peers: ReadonlyMap<string, Presence<P>>;\n    start(): void;\n    update(bytes: Uint8Array): Promise<void>;\n    sendState(): Promise<void>;\n    setPresence(data: P | null): void;\n    firstState(timeoutMs?: number): Promise<void>;\n    onChange(listener: () => void): () => void;\n    close(): void;\n};\nexport declare const COLOURS: string[];\nexport declare function createSealedSession<P = unknown>(o: SessionOptions<P>): SealedSession<P>;"
        }
      ],
      "pitfalls": [
        "The link is the key",
        "The part after # never reaches a server, but every script on the page can read it",
        "crypto.subtle exists only on secure pages",
        "The relay can drop, delay, reorder and replay messages",
        "A signature proves “someone holding the edit link”, not who",
        "Updates are not queued while the relay is away",
        "The relay still sees the room’s name, how many are connected, their addresses, and the size",
        "One sealing key for the session’s whole life",
        "The last-write-wins list refuses a write whose clock is more than 2^32 ahead of the highest it…",
        "Peer ids are random per page load (the default)",
        "The Cloudflare adapter is reference code"
      ],
      "card": "entries/sealed-relay.json"
    },
    {
      "id": "segment-loader",
      "aliases": [],
      "name": "Segment loader",
      "summary": "A long show held a few segments at a time: the current one and the next few in memory under a byte budget, past ones released, loading and GPU prep spread over frames in one allowance, every segment warmed unseen at start-up, and a soak harness that runs the show headless on the real GPU.",
      "category": "systems",
      "role": "system",
      "stack": [
        "three",
        "dom"
      ],
      "character": "calm",
      "tags": [
        "streaming",
        "loading",
        "memory budget",
        "vram",
        "warm-up",
        "compileAsync",
        "pipelines",
        "frame budget",
        "soak test",
        "live shows",
        "three internals",
        "webgpu"
      ],
      "useCases": [
        "live stage shows and keynotes",
        "long linear experiences and guided stories",
        "presentations with 3D scenes",
        "games with chapters or levels",
        "kiosks that run for hours",
        "soak and heat tests in CI"
      ],
      "interaction": "Choose a segment in the strip to jump to it · lower the memory budget or raise the texture size and loading ahead waits",
      "kits": [],
      "pairsWith": [
        {
          "id": "compile-without-stalls",
          "why": "Compiles each segment ahead"
        },
        {
          "id": "gpu-memory-ledger",
          "why": "The bytes its budget counts"
        },
        {
          "id": "cue-console",
          "why": "A show that runs segment by segment"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 0.347,
          "cpuMs": 0.465,
          "cpuP95Ms": 2.225,
          "badge": "light",
          "drawCalls": 31,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Warm-up off; the show runs at 4× with 3 s segments, so loading, GPU preparation and releases fall inside the measured frames (2 ahead, 1024² textures, 2 ms a frame)."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.835,
          "cpuMs": 1.185,
          "cpuP95Ms": 5.385,
          "badge": "moderate",
          "drawCalls": 37,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 377 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 1.457,
          "cpuMs": 0.14,
          "cpuP95Ms": 0.4,
          "badge": "moderate",
          "drawCalls": 15,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 198 ms."
        }
      ],
      "signatures": [
        {
          "file": "gpu-bytes.ts",
          "declarations": "export type GpuBytes = {\n    buffers: number;\n    textures: number;\n    count: number;\n    peak: number;\n};\nexport declare function countGpuBytes(device: GPUDevice): {\n    stats: () => GpuBytes;\n    resetPeak(): void;\n    uninstall(): void;\n};"
        },
        {
          "file": "memory.ts",
          "declarations": "export type MemoryKind = 'textures' | 'buffers' | 'audio' | 'video';\nexport declare const MEMORY_KINDS: readonly MemoryKind[];\nexport type Bytes = Partial<Record<MemoryKind, number>>;\nexport declare const MB = 1048576;\nexport declare function totalBytes(bytes: Bytes | null | undefined): number;\nexport declare function addBytes(a: Bytes, b: Bytes): Bytes;\nexport declare function overBy(bytes: Bytes, limit: Bytes): Bytes;\nexport declare const isOver: (over: Bytes) => boolean;\nexport declare function formatBlock(format: string): {\n    bytes: number;\n    w: number;\n    h: number;\n};\nexport declare function textureBytes(t: {\n    format: string;\n    width: number;\n    height: number;\n    depthOrArrayLayers?: number;\n    mipLevelCount?: number;\n    sampleCount?: number;\n    dimension?: string;\n}): number;\nexport declare function heldBytes(bytes: number): number;\nexport declare const audioBytes: (channels: number, frames: number) => number;\nexport declare const videoBytes: (width: number, height: number, frames?: number) => number;\ntype TextureLike = {\n    isTexture?: boolean;\n    isVideoTexture?: boolean;\n    isCompressedTexture?: boolean;\n    isRenderTargetTexture?: boolean;\n    image?: unknown;\n    source?: {\n        data?: unknown;\n    };\n    mipmaps?: Array<{\n        data?: ArrayBufferView;\n        width?: number;\n        height?: number;\n    }>;\n    type?: number;\n    format?: number;\n    generateMipmaps?: boolean;\n    minFilter?: number;\n};\ntype AttributeLike = {\n    array?: ArrayBufferView;\n    data?: {\n        array?: ArrayBufferView;\n    };\n};\ntype GeometryLike = {\n    attributes?: Record<string, AttributeLike>;\n    index?: AttributeLike | null;\n    morphAttributes?: Record<string, AttributeLike[]>;\n};\ntype ObjectLike = {\n    traverse?: (visit: (object: ObjectLike) => void) => void;\n    geometry?: GeometryLike;\n    material?: object | object[];\n    instanceMatrix?: AttributeLike;\n    instanceColor?: AttributeLike | null;\n};\nexport declare function threeTextureBytes(texture: TextureLike): {\n    kind: MemoryKind;\n    bytes: number;\n};\nexport declare function objectBytes(root: ObjectLike): Bytes;\nexport declare function formatBytes(bytes: number): string;\nexport {};"
        },
        {
          "file": "segment-loader.ts",
          "declarations": "import { FrameBudget, type BudgetOptions } from './frame-budget';\nimport { type Bytes } from './memory';\nexport type SegmentState = 'idle' | 'loading' | 'preparing' | 'ready' | 'failed';\nexport type LoadContext = {\n    index: number;\n    id: string;\n    signal: AbortSignal;\n    unit<T>(work: () => T): Promise<T>;\n    warming: boolean;\n};\nexport type Prep = {\n    uploads?: Array<() => void>;\n    compiles?: Array<() => PromiseLike<unknown> | void>;\n    draw?: (attempt: number) => PromiseLike<unknown>[] | void;\n};\nexport type SegmentSpec<C = unknown> = {\n    id: string;\n    estimate?: Bytes;\n    load(ctx: LoadContext): Promise<C>;\n    prepare?(content: C): Prep;\n    measure?(content: C): Bytes;\n    release(content: C): void;\n};\nexport type LoaderEvent = {\n    type: 'state';\n    index: number;\n    id: string;\n    state: SegmentState;\n} | {\n    type: 'ready';\n    index: number;\n    id: string;\n    loadMs: number;\n    prepMs: number;\n    bytes: Bytes;\n    warming: boolean;\n} | {\n    type: 'released';\n    index: number;\n    id: string;\n} | {\n    type: 'blocked';\n    index: number;\n    id: string;\n    needs: number;\n    free: number;\n} | {\n    type: 'over-budget';\n    index: number;\n    id: string;\n    over: Bytes;\n    measured: boolean;\n} | {\n    type: 'over-total';\n    index: number;\n    id: string;\n    bytes: number;\n    total: number;\n} | {\n    type: 'late';\n    index: number;\n    id: string;\n    state: SegmentState;\n} | {\n    type: 'failed';\n    index: number;\n    id: string;\n    error: string;\n};\nexport type WarmRow = {\n    index: number;\n    id: string;\n    ok: boolean;\n    loadMs: number;\n    prepMs: number;\n    bytes: Bytes;\n    over: Bytes | null;\n    error?: string;\n};\nexport type WarmReport = {\n    ok: boolean;\n    ms: number;\n    rows: WarmRow[];\n    peak: number;\n};\nexport type LoaderOptions<C> = {\n    segments: SegmentSpec<C>[];\n    start?: number;\n    ahead?: number;\n    behind?: number;\n    loop?: boolean;\n    budget?: {\n        total?: number;\n        perSegment?: Bytes;\n    };\n    frame?: BudgetOptions & {\n        urgentMs?: number;\n        warmMs?: number;\n    };\n    prep?: {\n        cap?: number;\n        inFlight?: number;\n    };\n    now?: () => number;\n    onEvent?: (event: LoaderEvent) => void;\n};\nexport type SegmentReport = {\n    index: number;\n    id: string;\n    state: SegmentState;\n    bytes: Bytes;\n    measured: boolean;\n    loads: number;\n    loadMs: number;\n    prepMs: number;\n    error: string;\n};\nexport type LoaderReport = {\n    current: number;\n    resident: number;\n    peak: number;\n    total: number;\n    segments: SegmentReport[];\n    waiting: {\n        units: number;\n        uploads: number;\n        compiles: number;\n        inFlight: number;\n    };\n};\nexport type SegmentLoader<C> = {\n    goTo(index: number): void;\n    frame(lastWorkMs?: number): void;\n    readonly current: number;\n    state(index: number): SegmentState;\n    isReady(index: number): boolean;\n    whenReady(index: number): Promise<boolean>;\n    content(index: number): C | undefined;\n    warmUp(onProgress?: (done: number, count: number, row: WarmRow) => void): Promise<WarmReport>;\n    readonly warming: boolean;\n    retry(index: number): void;\n    configure(options: Partial<Pick<LoaderOptions<C>, 'ahead' | 'behind' | 'loop' | 'budget' | 'frame' | 'prep'>>): void;\n    residentBytes(): number;\n    report(): LoaderReport;\n    readonly budget: FrameBudget;\n    dispose(): void;\n};\nexport declare function createSegmentLoader<C>(options: LoaderOptions<C>): SegmentLoader<C>;"
        },
        {
          "file": "three-prep.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Prep } from './segment-loader';\nexport declare function drawWithoutStalls(renderer: object, draw: () => void): Promise<unknown>[];\nexport declare function drawablesOf(root: THREE.Object3D): THREE.Object3D[];\nexport declare function texturesOf(root: THREE.Object3D): THREE.Texture[];\nexport declare function compileInTurn(renderer: THREE.WebGPURenderer, object: THREE.Object3D, camera: THREE.Camera, scene: THREE.Scene): Promise<void>;\nexport type ThreePrepOptions = {\n    renderer: THREE.WebGPURenderer;\n    scene: THREE.Scene;\n    render?: (camera: THREE.Camera) => void;\n};\nexport declare function threePrep(options: ThreePrepOptions): (root: THREE.Object3D, camera: THREE.Camera) => Prep;\nexport declare function disposeObject(root: THREE.Object3D, keepMaterials?: boolean): void;"
        }
      ],
      "pitfalls": [
        "Call loader.frame() before the frame’s own render",
        "Main-thread work in a load must go through ctx.unit()",
        "Lights belong to the scene, not to a segment",
        "Never run two renderer.compileAsync calls at once (three r187)",
        "compileAsync covers the camera’s pass only",
        "A released segment’s pipelines are freed by three (r187) when nothing draws with them",
        "Call goTo(next) once the old segment has left the screen",
        "A segment’s `estimate` is only a guess until it has loaded once",
        "With a post-processing pipeline, pass threePrep a `render` that draws your scene pass",
        "Opacity 0, visibility hidden and display none are not painted",
        "Byte counts are what was asked for"
      ],
      "card": "entries/segment-loader.json"
    },
    {
      "id": "shape-kit",
      "aliases": [],
      "name": "Shape kit",
      "summary": "Closed shapes from a few numbers, so a scene made in code never needs a hand-built mesh: bevelled boxes, blocks over any footprint with windows and doors set in as recesses with a pane, roofs (gable, hipped over any convex footprint, shed, flat) that are a slab of even thickness and build their own gable walls, so nothing is left open under the slope, a lathe, a sweep with mitred joints, and a sphere to roughen into rocks. Every solid is closed and wound outward, normals split at creases by an angle and are smooth elsewhere, UVs are in world metres (a texture keeps its size from wall to roof to post) and every part has a material slot: a built scene is one draw per slot, and a shape placed many times becomes instances. check() finds open seams, flipped faces, solids inside out, slivers and stretched UVs in any triangles, and draws them as lines. The core is plain arrays and imports nothing; a small adapter makes three meshes.",
      "category": "technique",
      "role": "foundation",
      "stack": [
        "three"
      ],
      "character": "calm",
      "tags": [
        "procedural",
        "geometry",
        "mesh",
        "closed mesh",
        "watertight",
        "normals",
        "crease angle",
        "uv",
        "world uv",
        "roof",
        "straight skeleton",
        "lathe",
        "sweep",
        "bevel",
        "windows",
        "instancing",
        "draw calls",
        "mesh check",
        "three.js",
        "webgpu",
        "webgl",
        "no dependencies"
      ],
      "useCases": [
        "houses, sheds, towers, quays and walls made in code for a scene that must load at once",
        "an agent or a generator that builds geometry and must not leave gaps or flipped faces",
        "checking a hand-built or imported mesh for open seams, flipped faces and stretched UVs",
        "textures that keep one size across walls, roofs and posts (bricks, planks, tiles)",
        "building geometry on a server or in a worker, without three"
      ],
      "interaction": "Drag to turn the yard · change the roof, pitch, storeys and windows · turn on the hand-built roof to see what the check finds",
      "kits": [],
      "pairsWith": [
        {
          "id": "auto-instancer",
          "why": "Batch the meshes of a scene built shape by shape"
        },
        {
          "id": "material-designer",
          "why": "Materials whose maps tile in metres, as the kit’s UVs are"
        },
        {
          "id": "compile-without-stalls",
          "why": "Build the slots’ materials before the first frame"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 0.224,
          "cpuMs": 0.25,
          "cpuP95Ms": 0.365,
          "badge": "light",
          "drawCalls": 19,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.22,
            "p99Ms": 6.245,
            "low1Fps": 148.8
          },
          "notes": "The default yard: a two-storey house with 28 windows and a door, a gable roof and chimney, a turned tower, a pavilion on eight instanced posts, a curved garden wall and six instanced crates, with the check overlay on. Built once at start; the frame cost is drawing it, about a dozen draws."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "intel xe-2lpg",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Microsoft Edge 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 1.311,
          "cpuMs": 0.565,
          "cpuP95Ms": 0.86,
          "badge": "moderate",
          "drawCalls": 19,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Microsoft Edge 157, Chromium 157 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 269 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 1.573,
          "cpuMs": 0.16,
          "cpuP95Ms": 0.62,
          "badge": "moderate",
          "drawCalls": 19,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 760 ms."
        }
      ],
      "signatures": [
        {
          "file": "shape-kit.ts",
          "declarations": "export * from './kit';\nexport * from './shapes';\nexport * from './check';\nexport * from './three-kit';"
        }
      ],
      "pitfalls": [
        "Closed is per solid",
        "Open seams come from shapes that stop where another begins",
        "Flipped faces: a polygon given in the wrong order faces in",
        "Stretched UVs: UVs are metres in each face’s own plane (or round a lathe, or along a sweep)",
        "Too many draws: one draw per slot for everything added once",
        "Gable and shed roofs need a rectangular footprint, and hipped and flat roofs a convex one",
        "A sweep keeps its profile upright",
        "Vertex colours: a slot with any coloured solid gets a colour attribute"
      ],
      "card": "entries/shape-kit.json"
    },
    {
      "id": "sheet-chart-suggest",
      "aliases": [],
      "name": "Chart suggestions from a sheet",
      "summary": "Hand it any table, pasted cells or a CSV, and it reads what each column holds (dates, money, percentages, durations, categories, IDs, free text, yes or no, with units from headers like \"Takings (€)\"), recognises the table’s shape (a time series, categories, a funnel, scenarios, ranges, a plan, a few key figures) and ranks the charts that fit, each with its reason in plain words. Rows that repeat are combined sensibly (counts and money added up; shares, durations and readings averaged), dates by the period that fits (months, weeks, days or hours) and said as people say them (\"1 Nov\", the year only when it changes). Pure and tested; small quiet SVG charts to show the pick, or feed the data to your own.",
      "category": "data",
      "role": "system",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "charts",
        "chart suggestions",
        "csv",
        "paste",
        "column profiling",
        "type detection",
        "units",
        "dates",
        "aggregation",
        "time series",
        "gantt",
        "funnel",
        "svg",
        "accessibility",
        "english and swedish",
        "no dependencies"
      ],
      "useCases": [
        "import a spreadsheet and show it at once",
        "a \"suggest a chart\" button",
        "dashboards built from whatever a person pastes",
        "reports from CSV exports",
        "reading a sheet’s columns before mapping them",
        "picking a period for a time chart"
      ],
      "interaction": "Pick a sample, drop or paste a CSV · pick a suggestion · hover or arrow through the chart · Table shows its numbers",
      "kits": [
        {
          "kit": "dashboard",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "streaming-spreadsheets",
          "why": "Read big sheets to suggest from"
        },
        {
          "id": "more-chart-types",
          "why": "The charts it suggests"
        },
        {
          "id": "quiet-charts",
          "why": "The everyday ones it suggests"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": null,
          "cpuMs": 6.01,
          "cpuP95Ms": 12.355,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "With bench on, every frame reads the next sample sheet (parse, profile, rank) and draws its next suggestion: the whole pipeline, about 250 to 650 rows a sheet."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 12.213,
          "cpuP95Ms": 22.23,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 92 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 7.59,
          "cpuP95Ms": 13.3,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 97 ms."
        }
      ],
      "signatures": [
        {
          "file": "chart-data.ts",
          "declarations": "import { type ColumnProfile, type ColumnType, type SensedTable } from './profile';\nimport { type Period } from './periods';\nimport { type ChartKind, type Suggestion } from './suggest';\nexport type Series = {\n    name: string;\n    values: (number | null)[];\n    column: number;\n    type: ColumnType;\n    unit: string;\n    currency: string;\n    how: 'sum' | 'mean' | null;\n};\nexport type DataTable = {\n    caption: string;\n    columns: string[];\n    rows: string[][];\n    numeric: boolean[];\n};\nexport type ChartData = {\n    kind: ChartKind;\n    title: string;\n    labels: string[];\n    series: Series[];\n    starts?: number[];\n    period?: Period;\n    periods?: Period[];\n    partial?: boolean[];\n    spans?: {\n        start: number;\n        end: number;\n        done: number | null;\n        group: number;\n    }[];\n    groups?: string[];\n    units?: string[];\n    told: string;\n    table: DataTable;\n};\nexport type ChartOptions = {\n    period?: Period;\n    measure?: number;\n};\nexport declare function formatValue(v: number | null, s: Pick<Series, 'type' | 'unit' | 'currency'>): string;\nexport declare function formatShort(v: number, s: Pick<Series, 'type' | 'unit' | 'currency'>): string;\nexport declare function grouped(t: SensedTable, catCol: number): SensedTable;\nexport declare function measuresOf(t: SensedTable, s: Suggestion): ColumnProfile[];\nexport declare const ROWS = -1;\nexport declare function chartFor(t: SensedTable, s: Suggestion, opts?: ChartOptions): ChartData;"
        },
        {
          "file": "draw.ts",
          "declarations": "import { type ChartData } from './chart-data';\nexport type DrawOptions = {\n    w: number;\n    h: number;\n    title?: string;\n    desc?: string;\n    motion?: boolean;\n};\nexport declare const esc: (s: unknown) => string;\nexport declare function niceTicks(lo: number, hi: number, count?: number): {\n    lo: number;\n    hi: number;\n    ticks: number[];\n};\nexport declare function squarify(values: readonly number[], rect: {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n}): {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n}[];\nexport declare function drawChart(d: ChartData, o: DrawOptions): string;\nexport declare function tableHtml(d: ChartData, cls?: string): string;"
        },
        {
          "file": "explore.ts",
          "declarations": "export type ExploreAt = {\n    k: number;\n    say: string;\n    x: number;\n    y: number;\n    via: 'pointer' | 'key';\n};\nexport declare function explore(svg: SVGSVGElement, onAt: (at: ExploreAt | null) => void, opts?: {\n    live?: HTMLElement;\n}): () => void;"
        },
        {
          "file": "profile.ts",
          "declarations": "import { type Grain } from './cells';\nimport { type Table } from './table';\nimport { TIME_WORDS, type Concept } from './vocabulary';\nexport type ColumnType = 'number' | 'money' | 'percent' | 'date' | 'duration' | 'category' | 'id' | 'text' | 'bool' | 'empty';\nexport type TimeWord = (typeof TIME_WORDS)[string];\nexport type ColumnProfile = {\n    index: number;\n    header: string;\n    name: string;\n    type: ColumnType;\n    unit: string;\n    per: TimeWord | null;\n    currency: string;\n    concept: Concept | null;\n    conceptScore: number;\n    count: number;\n    nulls: number;\n    distinct: number;\n    unique: boolean;\n    values: (number | null)[];\n    cells: string[];\n    min: number | null;\n    max: number | null;\n    sum: number;\n    integer: boolean;\n    monotonic: 'up' | 'down' | null;\n    sumsTo: boolean;\n    grain: Grain | null;\n    meanLength: number;\n    how: 'sum' | 'mean' | null;\n};\nexport type SensedTable = Table & {\n    columns: ColumnProfile[];\n};\nexport declare const CURRENCIES: Record<string, string>;\nexport declare function splitHeader(header: string): {\n    name: string;\n    unit: string;\n};\nexport declare function perOf(unit: string): TimeWord | null;\nexport declare function profileTable(t: Table): ColumnProfile[];\nexport declare const sense: (t: Table) => SensedTable;\nexport declare function profileColumn(header: string, cells: readonly string[], index?: number, totals?: readonly string[]): ColumnProfile;"
        },
        {
          "file": "suggest.ts",
          "declarations": "import type { ColumnProfile, SensedTable } from './profile';\nexport type ShapeId = 'timeseries' | 'categories' | 'funnel' | 'scenarios' | 'ranges' | 'gantt' | 'figures';\nexport type ChartKind = 'line' | 'columns' | 'lines' | 'bar' | 'donut' | 'treemap' | 'funnel' | 'grouped' | 'heatmap' | 'ranges' | 'gantt' | 'figures';\nexport type Roles = Partial<Record<'name' | 'value' | 'unit' | 'date' | 'start' | 'end' | 'time' | 'min' | 'likely' | 'max' | 'stage' | 'count' | 'conversion' | 'category' | 'measure' | 'scenario' | 'split', number>>;\nexport type Reading = {\n    shape: ShapeId;\n    confidence: number;\n    reason: string;\n    roles: Roles;\n    measures: number[];\n};\nexport type Suggestion = {\n    id: string;\n    shape: ShapeId;\n    kind: ChartKind;\n    title: string;\n    reason: string;\n    shows: string[];\n    score: number;\n    reading: Reading;\n};\nexport declare const figures: (c: ColumnProfile) => boolean;\nexport declare const list: (xs: readonly string[]) => string;\nexport declare const cap: (s: string) => string;\nexport declare const plural: (s: string) => string;\nexport declare const count: (n: number, one: string, many?: string) => string;\nexport declare function combinedWords(cols: readonly ColumnProfile[]): string;\nexport declare function readShapes(t: SensedTable): Reading[];\nexport declare function suggest(t: SensedTable, weights?: Readonly<Record<string, number>>): {\n    suggestions: Suggestion[];\n    readings: Reading[];\n    ambiguous: [\n        ShapeId,\n        ShapeId\n    ] | null;\n};"
        },
        {
          "file": "table.ts",
          "declarations": "export type Table = {\n    title: string;\n    header: string[];\n    rows: string[][];\n    totals: {\n        cells: string[];\n        sub: boolean;\n    }[];\n};\nexport declare function parseGrid(text: string): string[][];\nexport declare function readCell(s: string): {\n    n: number;\n    unit: string;\n} | null;\nexport declare function hasHeader(rows: readonly string[][]): boolean;\nexport declare function tableFromGrid(grid: readonly (readonly string[])[], title?: string): Table;\nexport declare const tableFromText: (text: string, title?: string) => Table;"
        }
      ],
      "pitfalls": [
        "A date like 3/4/2026 is read one way for the whole column",
        "readDate gives a week written without a year (\"week 42\") the current year",
        "Dates are UTC milliseconds throughout",
        "Rows that repeat are combined by each column’s `how`",
        "Learn from picks, not from browsing",
        "The confidences are rules of thumb, not probabilities",
        "Draw each chart at the size it is shown and redraw when that changes (a ResizeObserver)",
        "Import sheet-chart.base.css before sheet-chart.css",
        "Everything a person wrote (headers, cells, file names) reaches the SVG and the table through…",
        "Big sheets: profiling is linear in cells, but a time chart groups every row"
      ],
      "card": "entries/sheet-chart-suggest.json"
    },
    {
      "id": "shell-fur",
      "aliases": [],
      "name": "Combable shell fur",
      "summary": "Fur on the page’s own panels, in raw WebGPU (a WebGL2 twin draws the same fur where WebGPU is missing): each pelt (a rounded rect) is drawn again in shells, each cut into round strands that taper to their tips, with clumps, underfur, darker roots, two sheen lobes along the hair and a coat pattern (rosettes, stripes, scales, sheen, points). Drag across it and the hair turns your way and lies flat, and stays combed for most of a minute; a hand passing over lifts and parts it; a bristle wave stands it on end. Frames of fur round stitched suede plates keep text readable, and a strip that stands on end until it is stroked flat makes a comb-to-confirm control. It rests when nothing moves.",
      "category": "surface",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "fur",
        "shell fur",
        "hair",
        "strands",
        "comb",
        "groom",
        "kajiya-kay",
        "voronoi",
        "dom + gpu",
        "raw webgpu",
        "wgsl",
        "compute",
        "webgl2",
        "glsl",
        "timestamp queries",
        "rests when idle",
        "touch",
        "keyboard",
        "no dependencies"
      ],
      "useCases": [
        "a tactile, playful theme for panels and cards",
        "a comb-to-confirm control (stroke it flat), with a hold-to-confirm button beside it",
        "a hero surface people want to touch",
        "a fur, plush or velvet look for a children’s or pet app",
        "an animal’s coat seen from above, in 2D"
      ],
      "interaction": "Drag across the fur to comb it · hover lifts it · arrows comb the big coat when it has focus",
      "kits": [],
      "pairsWith": [
        {
          "id": "capability-tiers",
          "why": "Fewer shells on weak GPUs"
        },
        {
          "id": "dynamic-resolution",
          "why": "Hold the budget while the fur sways"
        },
        {
          "id": "textile-frames",
          "why": "Woven borders beside furry panels"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "Fourteen of the 16 shells, at most 1.5 pixels per CSS px.",
          "low": "Twelve of the 16 shells, at most 1 pixel per CSS px (a phone draws a quarter of its pixels)."
        },
        "reducedMotion": false
      },
      "toneKnobs": [
        {
          "name": "motion",
          "in": "module",
          "values": {
            "strict": 0,
            "refined": 0.5,
            "playful": 1
          },
          "note": "the sway and the hover lift, 0..1 (default 1)"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-13",
          "gpuMs": 2.713,
          "cpuMs": 0.205,
          "cpuP95Ms": 0.31,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Three pelts: a coat furred all over (about 560 × 380 px) and two framed panels with suede plates, 16 shells, wind on, a comb stroke drawn round the big coat every frame; the groom compute and the fur pass, timed with their own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 6.881,
          "cpuMs": 0.38,
          "cpuP95Ms": 0.525,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.723,
            "p99Ms": 17.98,
            "low1Fps": 53.7
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 530 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 11.488,
          "cpuMs": 0.38,
          "cpuP95Ms": 0.46,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 261 ms."
        }
      ],
      "signatures": [
        {
          "file": "dom-pelts.ts",
          "declarations": "import type { Pelt } from './looks';\nexport declare function readPelts(elements: Iterable<HTMLElement>, origin: DOMRect): Pelt[];\nexport declare function furAt(pelts: readonly Pelt[], x: number, y: number): number;"
        },
        {
          "file": "looks.ts",
          "declarations": "export type FurLook = {\n    length: number;\n    strand: number;\n    thickness: number;\n    density: number;\n    clumping: number;\n    rootShade: number;\n    lie: number;\n    sag: number;\n    wind: number;\n    layers: number;\n};\nexport declare const DEFAULT_FUR: FurLook;\nexport declare function furLook(input?: Partial<FurLook>): FurLook;\nexport declare const FUR_KNOBS: ReadonlyArray<{\n    key: keyof FurLook;\n    label: string;\n    unit: string;\n    min: number;\n    max: number;\n    step: number;\n    hint: string;\n}>;\nexport declare function furLayers(length: number, cap?: number): number;\nexport type FurTier = 'high' | 'medium' | 'low';\nexport declare const FUR_TIER: Record<FurTier, {\n    ratio: number;\n    layers: number;\n}>;\nexport declare function tierLayers(layers: number, tier?: FurTier): number;\nexport declare function tierRatio(dpr: number, tier?: FurTier): number;\nexport declare const PATTERNS: readonly [\n    \"rosettes\",\n    \"stripes\",\n    \"scales\",\n    \"sheen\",\n    \"points\"\n];\nexport type Pattern = (typeof PATTERNS)[number];\nexport type Coat = {\n    id: string;\n    name: string;\n    pattern: Pattern;\n    scale: number;\n    coat: [\n        string,\n        string,\n        string,\n        string\n    ];\n    tip: [\n        string,\n        number\n    ];\n    sheen: [\n        string,\n        number\n    ];\n    plate: [\n        string,\n        string\n    ];\n    stitch: string;\n    accent: string;\n    fur: Partial<FurLook>;\n};\nexport declare const COATS: Coat[];\nexport type Pelt = {\n    x: number;\n    y: number;\n    width: number;\n    height: number;\n    radius?: number;\n    band?: number;\n    plate?: boolean;\n    lift?: number;\n    length?: number;\n    glow?: number;\n    shadow?: number;\n};\nexport declare const MAX_PELTS = 32;\nexport declare const PELT_FLOATS = 12;\nexport declare function packPelts(pelts: readonly Pelt[], out: Float32Array): number;\nexport declare function hexRgb(hex: string): [\n    number,\n    number,\n    number\n];\nexport declare const SLOT: {\n    readonly res: 0;\n    readonly f0: 1;\n    readonly mouse: 2;\n    readonly grid: 3;\n    readonly fur: 4;\n    readonly fur2: 5;\n    readonly fur3: 6;\n    readonly coat0: 7;\n    readonly coat1: 8;\n    readonly coat2: 9;\n    readonly coat3: 10;\n    readonly tip: 11;\n    readonly sheen: 12;\n    readonly plate0: 13;\n    readonly plate1: 14;\n    readonly stitch: 15;\n    readonly accent: 16;\n    readonly bristle: 17;\n    readonly misc: 18;\n    readonly strokes: 19;\n};\nexport declare const MAX_STROKES = 8;\nexport declare const UNIFORM_VEC4: number;\nexport declare function packLook(look: FurLook, coat: Coat, u: Float32Array): void;"
        },
        {
          "file": "shell-fur.ts",
          "declarations": "import { type Coat, type FurLook, type FurTier, type Pelt } from './looks';\nexport type { FurTier } from './looks';\nexport type ShellFurOptions = {\n    device?: GPUDevice;\n    tier?: FurTier;\n    webgl?: boolean;\n    groomCell?: number;\n    onError?: (message: string) => void;\n    onLost?: (message: string) => void;\n};\nexport type FurFrame = {\n    dt: number;\n    motion?: number;\n};\nexport type ShellFur = {\n    device: GPUDevice | null;\n    backend: 'webgpu' | 'webgl2';\n    resize(width: number, height: number, dpr: number): void;\n    setPelts(pelts: readonly Pelt[]): void;\n    setLook(look: Partial<FurLook>, coat?: Coat): void;\n    pointer(x: number, y: number, speed: number): void;\n    leave(): void;\n    stroke(ax: number, ay: number, bx: number, by: number): void;\n    bristle(x: number, y: number, strength?: number): void;\n    smooth(): void;\n    combRadius: number;\n    settling(): number;\n    frame(f: FurFrame): boolean;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare function createShellFur(canvas: HTMLCanvasElement, { device: given, groomCell, onError, onLost, tier, webgl }?: ShellFurOptions): Promise<ShellFur | null>;"
        }
      ],
      "pitfalls": [
        "Without WebGPU, createShellFur draws the WebGL2 twin (unless webgl: false)",
        "Read the pelts’ rects every frame you draw (readPelts)",
        "The cost is per pixel of fur times shells",
        "On a weak GPU pass `tier`",
        "Text never goes on fur",
        "The comb lives in a buffer of the canvas’s size, one cell every 8 CSS px",
        "A drag combs only when it starts on fur (furAt)",
        "One stroke a frame from the last pointer position is enough at 60 Hz",
        "Under reduced motion pass motion",
        "The canvas is premultiplied",
        "The device can be lost after the fur starts (a driver reset, the GPU process gone)",
        "Resize on a new pixel ratio too"
      ],
      "card": "entries/shell-fur.json"
    },
    {
      "id": "site-plan",
      "aliases": [],
      "name": "Architect’s site plan in SVG",
      "summary": "A site plan drawn from plain data in the conventions of an architect’s drawing: the property line dash-dot, buildings hatched under heavy walls with their rooms, ground by its surface (lawn, gravel, paving, beds, water), paths at their true widths, trees with shadows, hedges, a north point, a scale bar that stays honest and a title block whose 1:N follows the zoom. Pan, pinch and zoom; lines keep their weight and hatching its spacing at every scale. Names sit in the margins on leader lines, then move onto the features as you zoom in; room, path and note labels appear only when they fit, and never overlap. Every name is a button you can reach by keyboard, and the schedule of areas gives the same facts as a table.",
      "category": "data",
      "role": "hero-visual",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "svg",
        "site plan",
        "architecture",
        "floor plan",
        "map",
        "zoom",
        "pan",
        "pinch",
        "labels",
        "label collision",
        "leader lines",
        "callouts",
        "scale bar",
        "north arrow",
        "hatching",
        "patterns",
        "keyboard",
        "accessibility",
        "no dependencies"
      ],
      "useCases": [
        "a campus, park, venue or office site with its buildings and grounds",
        "floor plans and room schedules",
        "showing what is proposed beside what exists",
        "picking a building or area from a drawing (bookings, facilities, maintenance)",
        "any zoomable SVG drawing whose labels must stay calm",
        "a map drawn from your own data, with no tiles and no map library"
      ],
      "interaction": "Drag to pan · wheel (after a click) or pinch to zoom · click a name or an area · Tab to the names, arrows between them, Enter to zoom to one",
      "kits": [],
      "pairsWith": [
        {
          "id": "progressive-path-tracer",
          "why": "A rendered view of the planned building"
        },
        {
          "id": "file-io",
          "why": "Print the plan as PDF or SVG"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": null,
          "cpuMs": 0.02,
          "cpuP95Ms": 0.04,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 20.517,
            "p99Ms": 32.875,
            "low1Fps": 29.9
          },
          "notes": "Measured with the plan zooming itself: every frame the camera eases between the whole plot and about four times closer and back (a 3 s cycle), so each frame moves the drawing, rescales the hatching, lays out the callouts and dimensions again and culls the room, path and note labels. At rest nothing runs."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.03,
          "cpuP95Ms": 0.055,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 66 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.02,
          "cpuP95Ms": 0.04,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 151 ms."
        }
      ],
      "signatures": [
        {
          "file": "geometry.ts",
          "declarations": "export type Pt = readonly [\n    number,\n    number\n];\nexport type Ring = readonly Pt[];\nexport type Box = {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n};\nexport declare const rect: (x0: number, y0: number, x1: number, y1: number) => Ring;\nexport declare function ellipse(cx: number, cy: number, rx: number, ry: number, n?: number, wobble?: number, seed?: number): Ring;\nexport declare function areaOf(ring: Ring): number;\nexport declare function lengthOf(points: Ring): number;\nexport declare function boundsOf(points: Iterable<Pt>): Box;\nexport declare function inside(p: Pt, ring: Ring): boolean;\nexport declare function labelPoint(ring: Ring): Pt;\nexport declare function offsetPath(line: Ring, width: number): Ring;\nexport declare function pointsAlong(points: Ring, spacing: number): Array<{\n    at: Pt;\n    angle: number;\n}>;\nexport declare function midOf(points: Ring): {\n    at: Pt;\n    angle: number;\n};\nexport declare function hash01(x: number, y: number): number;\nexport declare function canopyPath(at: Pt, r: number, kind?: 'broadleaf' | 'conifer' | 'fruit' | 'shrub'): string;\nexport declare const ringPath: (ring: Ring) => string;\nexport declare function paperScale(pxPerMetre: number): number;\nexport declare function scaleBar(pxPerMetre: number, maxPx?: number): {\n    metres: number;\n    px: number;\n    parts: number;\n};\nexport type LabelCandidate = {\n    id: string;\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n    angle?: number;\n    priority: number;\n    force?: boolean;\n};\nexport declare function labelBox(c: LabelCandidate): Box;\nexport declare function placeLabels(cands: readonly LabelCandidate[], view: Box, blocked?: readonly Box[], pad?: number): Set<string>;\nexport type CalloutAnchor = {\n    id: string;\n    ax: number;\n    ay: number;\n};\nexport type CalloutPlace = CalloutAnchor & {\n    side: 'left' | 'right';\n    lx: number;\n    ly: number;\n};\nexport declare function layoutCallouts(anchors: readonly CalloutAnchor[], o: {\n    left: number;\n    right: number;\n    top: number;\n    bottom: number;\n    gap: number;\n    split?: number;\n}): CalloutPlace[];\nexport type ScheduleRow = {\n    id: string;\n    name: string;\n    kind: string;\n    status: string;\n    area: number;\n    detail: string;\n};\nexport declare const m2: (n: number) => string;"
        },
        {
          "file": "site-plan.ts",
          "declarations": "import { type Box, type Pt, type Ring, type ScheduleRow } from './geometry';\nexport type SiteRoom = {\n    name: string;\n    outline: Ring;\n};\nexport type SiteBuilding = {\n    id: string;\n    name: string;\n    outline: Ring;\n    rooms?: SiteRoom[];\n    kind?: 'building' | 'glasshouse' | 'canopy';\n    status?: 'existing' | 'proposed';\n    note?: string;\n};\nexport type AreaKind = 'lawn' | 'meadow' | 'paving' | 'gravel' | 'beds' | 'water' | 'road' | 'play';\nexport type SiteArea = {\n    id: string;\n    name: string;\n    kind: AreaKind;\n    shapes: Ring[];\n    note?: string;\n    callout?: boolean;\n};\nexport type SitePath = {\n    id: string;\n    name?: string;\n    kind: 'paved' | 'gravel' | 'stones' | 'boardwalk';\n    points: Ring;\n    width: number;\n};\nexport type SiteTree = {\n    at: Pt;\n    r: number;\n    kind?: 'broadleaf' | 'conifer' | 'fruit' | 'shrub';\n    group?: string;\n};\nexport type SiteHedge = {\n    name?: string;\n    points: Ring;\n    width: number;\n};\nexport type SiteNote = {\n    at: Pt;\n    text: string;\n    angle?: number;\n    priority?: number;\n};\nexport type SiteGroup = {\n    id: string;\n    name: string;\n    note?: string;\n};\nexport type SitePlanData = {\n    title: string;\n    subtitle?: string;\n    plot: Ring;\n    north?: number;\n    buildings: SiteBuilding[];\n    areas?: SiteArea[];\n    paths?: SitePath[];\n    trees?: SiteTree[];\n    hedges?: SiteHedge[];\n    notes?: SiteNote[];\n    groups?: SiteGroup[];\n};\nexport type Feature = {\n    id: string;\n    name: string;\n    type: string;\n    proposed: boolean;\n    area: number;\n    detail: string;\n    anchor: Pt;\n    box: Box;\n};\nexport declare const featureLine: (f: Feature) => string;\nexport declare function featuresOf(data: SitePlanData, opts?: {\n    proposed?: boolean;\n}): Feature[];\nexport declare function scheduleOf(data: SitePlanData, opts?: {\n    proposed?: boolean;\n}): {\n    rows: ScheduleRow[];\n    totals: {\n        site: number;\n        built: number;\n        proposed: number;\n        coverage: number;\n        soft: number;\n        softShare: number;\n        pathLength: number;\n        trees: number;\n    };\n};\nexport type SitePlanOptions = {\n    callouts?: 'auto' | 'margins' | 'inside';\n    grid?: boolean;\n    planting?: boolean;\n    proposed?: boolean;\n    dimensions?: boolean;\n    controls?: boolean;\n    insets?: {\n        top?: number;\n        right?: number;\n        bottom?: number;\n        left?: number;\n    };\n    wheel?: 'focus' | 'always';\n    motion?: boolean;\n    label?: string;\n    onSelect?: (id: string | null) => void;\n    onView?: (view: {\n        zoom: number;\n        scale: number;\n        fitZoom: number;\n    }) => void;\n};\nexport type SitePlan = {\n    fit(animate?: boolean): void;\n    zoomTo(id: string, animate?: boolean): void;\n    zoomBy(factor: number, animate?: boolean): void;\n    select(id: string | null): void;\n    readonly selected: string | null;\n    set(options: Partial<SitePlanOptions>): void;\n    setData(data: SitePlanData): void;\n    draw(): void;\n    view(): {\n        zoom: number;\n        scale: number;\n        fitZoom: number;\n    };\n    features(): Feature[];\n    dispose(): void;\n};\nexport declare function createSitePlan(host: HTMLElement, initial: SitePlanData, options?: SitePlanOptions): SitePlan;"
        }
      ],
      "pitfalls": [
        "Coordinates are metres with y pointing south (down the screen), as SVG has it",
        "Strokes keep their screen weight through vector-effect",
        "The hatching and stipples keep their spacing because their patterns are rescaled on every view…",
        "The overlay is laid out in screen pixels on every view change",
        "The wheel zooms only after the plan has been clicked or focused (Ctrl or a pinch always zoom)",
        "Label widths are estimated from the character count, not measured",
        "Names and notes reach the SVG through esc()",
        "insets keep the names and chrome out of an app’s own bars and panels",
        "Pattern ids are made unique per plan (spl1-hatch…), so several plans can share a page"
      ],
      "card": "entries/site-plan.json"
    },
    {
      "id": "skin-seam",
      "aliases": [],
      "name": "Reskin seam for 2D games and visual apps",
      "summary": "A contract that lets one simulation wear any number of looks. The rules draw nothing: each frame a view walks their state and calls the skin’s draw table for every thing it finds, and hands every rule event to the skin’s fx table, which turns it into bursts, flashes, fading lights and rings. Both write through a pen: 16-float instances, each a signed-distance shape (seventeen of them, with fill, outline, rim and halo) or a rectangle of the skin’s atlas, into three layers, each one instanced draw. A WebGPU backend and a Canvas 2D backend draw the same frame. Optional 2D lighting keeps lit things, lights and glowing things apart, then multiplies the light in and adds the glow with bloom; a grid under everything bends round the rings; a pixel-art skin draws on a coarse grid scaled up hard. The demo is a harbour drawn twice, split by a seam you drag: a chart, pixel art or lanterns at night on each side, each on WebGPU or Canvas 2D, all from one run of the rules.",
      "category": "technique",
      "role": "system",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "reskin",
        "skins",
        "themes",
        "separation of rules and rendering",
        "view",
        "draw table",
        "event effects",
        "instancing",
        "sdf shapes",
        "sprite atlas",
        "pixel art",
        "2d lighting",
        "light layer",
        "glow",
        "bloom",
        "grid warp",
        "shock rings",
        "canvas 2d fallback",
        "canvas 2d",
        "raw webgpu",
        "wgsl",
        "deterministic",
        "fixed timestep",
        "seeded",
        "timestamp queries",
        "draw on demand",
        "no dependencies"
      ],
      "useCases": [
        "a 2D game whose art can be swapped (themes, seasons, an accessibility look, a retro mode) without touching its rules",
        "one simulation shown in several looks at once: a comparison, an editor preview, a split screen",
        "a dashboard, map or visual app that draws thousands of marks in one instanced call, with a Canvas 2D fallback that draws the same frame",
        "night scenes in 2D: lamps, lanterns and beams that light what is near them, with glow and bloom",
        "pixel art from sprites and code-drawn shapes alike, on a coarse grid that keeps every pixel the same size",
        "rules that are tested, replayed and networked on their own, because nothing in them draws"
      ],
      "interaction": "Drag the seam (or arrow keys on its handle) · pick a skin and a renderer for each side · click the water to drop a stone",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "pixel-art-layer",
          "why": "A pixel-art skin"
        },
        {
          "id": "play-input",
          "why": "Input for the same game"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [
        {
          "name": "calm",
          "in": "module",
          "values": {
            "strict": true
          },
          "note": "fewer particles and no bending"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.432,
          "cpuMs": 0.685,
          "cpuP95Ms": 1.38,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with Chart on the left and Lantern on the right, both on WebGPU and split half and half: about 300 to 500 instances a side in three layers, the field, the lights, glow and three bloom levels on the right, a stone dropped every 0.45 s so rings bend the field; both sides timed by their own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.311,
          "cpuMs": 0.62,
          "cpuP95Ms": 0.985,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 202 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 7.503,
          "cpuMs": 0.96,
          "cpuP95Ms": 1.54,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 493 ms."
        }
      ],
      "signatures": [
        {
          "file": "flat.ts",
          "declarations": "import type { Backend } from './gpu';\nexport declare function createFlatBackend(canvas: HTMLCanvasElement | OffscreenCanvas): Backend;"
        },
        {
          "file": "gpu.ts",
          "declarations": "import { type Frame } from './pen';\nimport type { AtlasSource } from './skin';\nexport type Backend = {\n    readonly kind: 'webgpu' | 'canvas2d';\n    setAtlas(source: AtlasSource, pixelated?: boolean): void;\n    render(f: Frame, clip?: readonly [\n        number,\n        number\n    ]): boolean;\n    ms(): number | null;\n    readonly lost: boolean;\n    onLost: ((reason: string) => void) | null;\n    dispose(): void;\n};\nexport type Gpu = {\n    device: GPUDevice;\n    format: GPUTextureFormat;\n    timed: boolean;\n};\nexport declare function requestGpu(): Promise<Gpu | null>;\nexport declare function createGpuBackend(canvas: HTMLCanvasElement | OffscreenCanvas, { gpu }?: {\n    gpu?: Gpu | null;\n}): Promise<Backend | null>;"
        },
        {
          "file": "pen.ts",
          "declarations": "export declare const SHAPE: {\n    readonly DISC: 0;\n    readonly RING: 1;\n    readonly TRI: 2;\n    readonly BOX: 3;\n    readonly HEX: 4;\n    readonly STAR: 5;\n    readonly CHEVRON: 6;\n    readonly CAPSULE: 7;\n    readonly ARC: 8;\n    readonly SOFT: 9;\n    readonly PLUS: 10;\n    readonly DIAMOND: 11;\n    readonly SPRITE: 12;\n    readonly WEDGE: 13;\n    readonly DASHED: 14;\n    readonly LENS: 15;\n    readonly PEBBLE: 16;\n};\nexport type Shape = (typeof SHAPE)[keyof typeof SHAPE];\nexport declare const SHAPE_COUNT = 17;\nexport declare const FLOATS = 16;\nexport type Rgb = readonly [\n    number,\n    number,\n    number\n];\nexport type AtlasFrame = readonly [\n    number,\n    number,\n    number,\n    number\n];\nexport type Layer = {\n    readonly data: Float32Array;\n    count: number;\n    readonly capacity: number;\n    shape(shape: Shape, x: number, y: number, sx: number, sy: number, rot: number, c: Rgb, a?: number, fill?: number, glow?: number, round?: number, rim?: number, seed?: number): void;\n    sprite(f: AtlasFrame, x: number, y: number, sx: number, sy: number, rot?: number, c?: Rgb, a?: number): void;\n    reset(): void;\n};\nexport declare function createLayer(capacity?: number): Layer;\nexport type Field = {\n    kind: 'grid' | 'none';\n    bg0: Rgb;\n    bg1: Rgb;\n    centre: readonly [\n        number,\n        number\n    ];\n    fade: number;\n    ink: Rgb;\n    inkAlpha: number;\n    spacing: number;\n    major: number;\n    lines: readonly [\n        number,\n        number\n    ];\n    wave: number;\n    bend: number;\n    shine: number;\n};\nexport type SceneLook = {\n    clear: Rgb;\n    accent: Rgb;\n    lighting: boolean;\n    ambient: Rgb;\n    lightGain: number;\n    glowGain: number;\n    bloom: number;\n    vignette: number;\n    warp: number;\n    pixel: number;\n    field: Field;\n};\nexport declare const NO_FIELD: Field;\nexport declare const PLAIN_LOOK: SceneLook;\nexport type Camera = {\n    x: number;\n    y: number;\n    scale: number;\n};\nexport declare const MAX_RINGS = 12;\nexport type Frame = {\n    lit: Layer;\n    glow: Layer;\n    lights: Layer;\n    light(x: number, y: number, radius: number, c: Rgb, a?: number): void;\n    visible(x: number, y: number, margin?: number): boolean;\n    camera: Camera;\n    w: number;\n    h: number;\n    time: number;\n    look: SceneLook;\n    rings: Float32Array;\n    ringCount: number;\n    begin(w: number, h: number, camera: Camera, time: number, look: SceneLook): void;\n    ring(x: number, y: number, radius: number, strength: number): void;\n};\nexport declare function createFrame({ lit, glow, lights }?: {\n    lit?: number | undefined;\n    glow?: number | undefined;\n    lights?: number | undefined;\n}): Frame;\nexport declare function fitCamera(fit: readonly [\n    number,\n    number,\n    number,\n    number\n], w: number, h: number): Camera;\nexport declare const toScreen: (c: Camera, w: number, h: number, x: number, y: number) => [\n    number,\n    number\n];\nexport declare const toWorld: (c: Camera, w: number, h: number, sx: number, sy: number) => [\n    number,\n    number\n];"
        },
        {
          "file": "skin.ts",
          "declarations": "import type { Fx } from './fx';\nimport type { SceneLook } from './pen';\nexport type Theme = 'light' | 'dark';\nexport type Palette = {\n    scene: SceneLook;\n};\nexport type RuleEvent = {\n    type: string;\n};\nexport type FxTable<E extends RuleEvent, P> = {\n    [K in E['type']]?: (fx: Fx, e: Extract<E, {\n        type: K;\n    }>, P: P) => void;\n};\nexport type AtlasSource = HTMLCanvasElement | OffscreenCanvas | ImageBitmap | HTMLImageElement;\nexport type Skin<D, E extends RuleEvent, P extends Palette> = {\n    id: string;\n    name: string;\n    palette(theme: Theme): P;\n    draw: D;\n    fx: FxTable<E, P>;\n    atlas?: () => AtlasSource | Promise<AtlasSource>;\n    pixelated?: boolean;\n};\nexport declare function extendSkin<D extends object, E extends RuleEvent, P extends Palette>(base: Skin<D, E, P>, over: {\n    id: string;\n    name: string;\n    palette?: (theme: Theme) => P;\n    draw?: Partial<D>;\n    fx?: FxTable<E, P>;\n    atlas?: Skin<D, E, P>['atlas'];\n    pixelated?: boolean;\n}): Skin<D, E, P>;"
        },
        {
          "file": "view.ts",
          "declarations": "import { type Fx } from './fx';\nimport { type Camera, type Frame } from './pen';\nimport type { Palette, RuleEvent, Skin, Theme } from './skin';\nexport type Walk<S, D, P> = (state: S, draw: D, pen: Frame, time: number, P: P) => void;\nexport type ViewOptions<S, D, E extends RuleEvent, P extends Palette> = {\n    skin: Skin<D, E, P>;\n    walk: Walk<S, D, P>;\n    theme?: Theme;\n    seed?: number;\n    calm?: boolean;\n    lite?: boolean;\n    capacity?: {\n        lit?: number;\n        glow?: number;\n        lights?: number;\n    };\n};\nexport type View<S, D, E extends RuleEvent, P extends Palette> = {\n    readonly skin: Skin<D, E, P>;\n    readonly palette: P;\n    readonly fx: Fx;\n    readonly frame: Frame;\n    setSkin(skin: Skin<D, E, P>): void;\n    setTheme(theme: Theme): void;\n    build(state: S, events: readonly E[], dt: number, size: {\n        w: number;\n        h: number;\n        camera: Camera;\n    }): Frame;\n    counts(): {\n        lit: number;\n        glow: number;\n        lights: number;\n        particles: number;\n        rings: number;\n    };\n};\nexport declare function createView<S, D, E extends RuleEvent, P extends Palette>(o: ViewOptions<S, D, E, P>): View<S, D, E, P>;"
        }
      ],
      "pitfalls": [
        "The rules must not import anything that draws, and the walk must not change the state",
        "Hand the same event list to every view, and drain it once",
        "setSkin() drops the effects in flight",
        "Skins animate by the view’s own clock, which only moves in build()",
        "A palette given to extendSkin() replaces the base’s, and the borrowed draw functions read it",
        "A WebGPU canvas can never become a Canvas 2D one",
        "Instance sizes are half-sizes, and shapes point along +x before rotation, on both backends",
        "The outline of a shape drawn with fill below 1 is 17% of its shorter half-size",
        "With `pixel` set, the lit and glow layers are drawn on a grid of k device pixels per art pixel",
        "Canvas 2D cannot tint a sprite without per-pixel work",
        "Canvas 2D leaves out the picture warp",
        "A WebGPU device can be lost (a driver reset, a sleeping laptop, another tab’s crash). render()…",
        "A canvas wider or taller than the device’s maxTextureDimension2D cannot be drawn into.…",
        "The light layer multiplies the lit layer only where `lighting` is on, and glows are added",
        "render() returns false while the GPU is still busy with the last frame",
        "The field and the lit layer share a rgba8unorm target"
      ],
      "card": "entries/skin-seam.json"
    },
    {
      "id": "slide-show-player",
      "aliases": [],
      "name": "Slide-show player for HTML slides",
      "summary": "Plays a deck of HTML slides the way PowerPoint presents: each slide in its own frame, the slides either side loaded ahead and held before their entrance, so moving on is instant. Every input steps by the same rules (click, keys, wheel, right-click back), Back undoes a build before it leaves the slide, a press lands a transition at once, and eight transitions run on Web Animations. With a small slide side that turns data-step attributes into builds.",
      "category": "ui",
      "role": "system",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "slides",
        "presentation",
        "slide show",
        "deck",
        "iframe",
        "preloading",
        "transitions",
        "web animations",
        "builds",
        "keyboard",
        "wheel",
        "full screen",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "presenting HTML or exported slide decks",
        "product tours and onboarding steps",
        "kiosk and lobby screens",
        "step-by-step explainers and stories",
        "showing generated reports one page at a time"
      ],
      "interaction": "Click, → or the wheel for the next build or slide · right-click or ← to undo a build · Home / End · Full screen in the tools",
      "kits": [],
      "pairsWith": [
        {
          "id": "slide-transitions",
          "why": "GPU transitions between slides"
        },
        {
          "id": "lan-remote",
          "why": "Step it from a phone"
        },
        {
          "id": "offline-narrator",
          "why": "Narrate each slide"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.80",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-04",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.01,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured stepping through the deck from code, one press every 28 frames (each build, then the next slide with a push transition, back to the first at the end): the player loading the next slide into its frame, parking and dropping frames, and the slide’s steps. The transitions and builds are CSS and Web Animations, run by the compositor. Nothing runs between presses."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 0.01,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 43 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.02,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 50 ms."
        }
      ],
      "signatures": [
        {
          "file": "player.ts",
          "declarations": "import { type Transition } from './keyframes';\nexport type SlideApi = {\n    start?(): unknown;\n    hold?(): unknown;\n    advance?(): boolean;\n    back?(): boolean;\n    toEnd?(): unknown;\n    warm?(): unknown;\n};\nexport type PlayerOptions = {\n    stage: HTMLElement;\n    count: number;\n    load(frame: HTMLIFrameElement, i: number): void;\n    loaded?(frame: HTMLIFrameElement, i: number): void;\n    transition(i: number): Transition;\n    shown?(i: number): void;\n    key?(e: KeyboardEvent, inSlide: boolean): boolean;\n    ignore?(e: KeyboardEvent, inSlide: boolean): boolean;\n    blocked?(): boolean;\n    activity?(): void;\n    home?(): void;\n    preloadAll?: boolean;\n    progress?(loaded: number, of: number): void;\n};\nexport type SlidePlayer = {\n    go(i: number): boolean;\n    next(): void;\n    prev(): void;\n    key(e: KeyboardEvent, inSlide: boolean): boolean;\n    wheel(e: WheelEvent): void;\n    readonly index: number;\n    each(fn: (frame: HTMLIFrameElement, i: number) => void): void;\n    stop(): void;\n};\nexport declare function createSlidePlayer(o: PlayerOptions): SlidePlayer;"
        },
        {
          "file": "slide-steps.ts",
          "declarations": "import type { SlideApi } from './player';\nexport declare const SLIDE_STEPS_CSS: string;\nexport type SlideStepsOptions = {\n    click?: boolean;\n    stagger?: number;\n    gap?: number;\n    onStep?(shown: number, count: number): void;\n};\nexport type SlideSteps = Required<Omit<SlideApi, 'warm'>> & {\n    readonly shown: number;\n    readonly count: number;\n    readonly held: boolean;\n};\nexport declare function installSlideSteps(win: Window, options?: SlideStepsOptions): SlideSteps;"
        }
      ],
      "pitfalls": [
        "Slides must be same origin (srcdoc, or src on your own host)",
        "Hand the player your page’s keys yourself",
        "The stage must be positioned with overflow hidden",
        "A wheel over a slide in a page that scrolls also scrolls the page (the frame chains it up)",
        "Install the slide side in loaded(), and put SLIDE_STEPS_CSS in each slide’s head too",
        "Only the current slide and its neighbours are kept (two frames at most besides it)",
        "Back shows the previous slide finished (toEnd), not from its start, as PowerPoint does",
        "Clicks on a slide’s own controls (button, a, input, label, [data-no-advance]) don’t step",
        "Screen readers: each frame has a title, and the host should announce the slide"
      ],
      "card": "entries/slide-show-player.json"
    },
    {
      "id": "slide-transitions",
      "aliases": [],
      "name": "Slide transitions",
      "summary": "Six ways from one picture to the next on WebGPU: a light sweep, a circuit wipe racing across, glass shattering into falling shards, an ink bloom, a warp through a white heart and cells turning to digits that lift off. Any two images, a kind and a progress 0..1; or play it over a duration with an easing.",
      "category": "post",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "transitions",
        "wgsl",
        "raw webgpu",
        "slides",
        "wipe",
        "shatter",
        "instancing",
        "easing"
      ],
      "useCases": [
        "slide decks and presentations",
        "image galleries and carousels",
        "scene changes in games",
        "onboarding steps",
        "video and photo editors",
        "title sequences"
      ],
      "interaction": "Click, tap or press → for the next picture · scrub with Progress",
      "kits": [
        {
          "kit": "product-presentation",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "slide-show-player",
          "why": "Slides to transition between"
        },
        {
          "id": "video-textures",
          "why": "Video slides in the scene"
        },
        {
          "id": "arrival-shockwave",
          "why": "A title moment before the first slide"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "calm",
          "in": "demo",
          "values": {
            "strict": true
          },
          "note": "a short cross-fade in place of the kind"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 0.279,
          "cpuMs": 0,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Plays all six transitions back to back, one picture to the next, at the stage’s size: one full-screen pass each (the shatter adds 288 shard triangles over it), timed with its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.328,
          "cpuMs": 0.005,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 329 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 6.153,
          "cpuMs": 0,
          "cpuP95Ms": 0.02,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 116 ms."
        }
      ],
      "signatures": [
        {
          "file": "slide-transitions.ts",
          "declarations": "export type TransitionKind = 'sweep' | 'circuit' | 'shatter' | 'ink' | 'warp' | 'cells' | 'fade';\nexport type Picture = GPUCopyExternalImageSource;\nexport type Easing = 'linear' | 'in' | 'out' | 'inOut' | ((t: number) => number);\nexport declare const TRANSITIONS: Record<TransitionKind, {\n    name: string;\n    duration: number;\n    angle: number;\n    easing: Easing;\n}>;\nexport declare function ease(easing: Easing, x: number): number;\nexport type TransitionLook = {\n    angle?: number;\n    glow?: number;\n    seed?: number;\n    time?: number;\n};\nexport type PlayOptions = TransitionLook & {\n    duration?: number;\n    easing?: Easing;\n    reduce?: boolean;\n};\nexport type SlideTransitions = {\n    readonly device: GPUDevice;\n    setPictures(from: Picture, to: Picture): void;\n    setPicture(which: 'from' | 'to', picture: Picture): void;\n    setWords(text: string): void;\n    setColours(glow: string, accent: string): void;\n    draw(kind: TransitionKind, progress: number, look?: TransitionLook): void;\n    play(kind: TransitionKind, options?: PlayOptions): Promise<boolean>;\n    stop(): void;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport type TransitionOptions = {\n    device?: GPUDevice;\n    fit?: 'cover' | 'stretch';\n    glow?: string;\n    accent?: string;\n    font?: string;\n};\nexport declare function createSlideTransitions(canvas: HTMLCanvasElement, options?: TransitionOptions): Promise<SlideTransitions | null>;\nexport declare function crossFade(from: HTMLElement, to: HTMLElement, { duration, easing }?: {\n    duration?: number | undefined;\n    easing?: string | undefined;\n}): Promise<void>;"
        }
      ],
      "pitfalls": [
        "The pictures must be loaded when you hand them over",
        "It draws at the canvas’s own width and height",
        "Progress 0 is the first picture exactly and 1 the second exactly",
        "Pictures are cover-fitted to the canvas (cropped at the edges)",
        "Light over 1 clips to white",
        "draw() and play() each stop a play in progress (its promise resolves false)",
        "Never more than one draw on the GPU at a time"
      ],
      "card": "entries/slide-transitions.json"
    },
    {
      "id": "smart-guides",
      "aliases": [],
      "name": "Smart guides, align and handles",
      "summary": "The pure geometry behind editing shapes on a board: smart guides that snap to other shapes’ edges, middles and equal gaps, align and distribute, turned boxes (hit tests, bounds, resize along their own axes, group scale and turn) and the resize and rotate handles round them.",
      "category": "canvas",
      "role": "system",
      "stack": [
        "headless"
      ],
      "character": "calm",
      "tags": [
        "snapping",
        "smart guides",
        "equal spacing",
        "align",
        "distribute",
        "resize handles",
        "rotation",
        "hit testing",
        "no dependencies"
      ],
      "useCases": [
        "design tools and whiteboards",
        "diagram and node editors",
        "slide and page layout",
        "dashboard builders",
        "floor plans"
      ],
      "interaction": "Drag shapes to snap · corners resize, just outside them turns · Alt drags freely",
      "kits": [],
      "pairsWith": [
        {
          "id": "infinite-canvas",
          "why": "The board the shapes live on"
        },
        {
          "id": "arrange-in-place",
          "why": "Arrange a live page with the same guides"
        },
        {
          "id": "transform-rig",
          "why": "Handles for 3D objects"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.80",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-03",
          "gpuMs": null,
          "cpuMs": 0.195,
          "cpuP95Ms": 0.28,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with a card dragged round the board by script, snapping every frame: each frame runs the edge, middle and equal-spacing snaps against the other eleven shapes and the board, then moves the card and redraws the guides, gap labels and handles."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.3,
          "cpuP95Ms": 0.515,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 74 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.26,
          "cpuP95Ms": 0.36,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 54 ms."
        }
      ],
      "signatures": [
        {
          "file": "arrange.ts",
          "declarations": "import type { Rect, Vec2 } from './camera';\nexport type AlignMode = 'left' | 'centre' | 'right' | 'top' | 'middle' | 'bottom';\nexport type Placed = {\n    id: string;\n    rect: Rect;\n};\nexport declare function alignMoves(items: readonly Placed[], mode: AlignMode): Map<string, Vec2>;\nexport declare function distributeMoves(items: readonly Placed[], axis: 'x' | 'y'): Map<string, Vec2>;\nexport declare function frameAt(p: Vec2, frames: readonly Placed[], except?: ReadonlySet<string>): string | null;"
        },
        {
          "file": "camera.ts",
          "declarations": "export type Vec2 = {\n    x: number;\n    y: number;\n};\nexport type Rect = {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n};"
        },
        {
          "file": "geometry.ts",
          "declarations": "import type { Rect, Vec2 } from './camera';\nexport type Box = {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n    rotation: number;\n};\nexport type Handle = 'n' | 's' | 'e' | 'w' | 'ne' | 'nw' | 'se' | 'sw';\nexport declare const CORNERS: readonly Handle[];\nexport declare const SIDES: readonly Handle[];\nexport declare const HANDLE_DIR: Record<Handle, readonly [\n    number,\n    number\n]>;\nexport declare function rotate(p: Vec2, degrees: number): Vec2;\nexport declare const centreOf: (b: Rect) => Vec2;\nexport declare function toWorld(b: Box, local: Vec2): Vec2;\nexport declare function toLocal(b: Box, p: Vec2): Vec2;\nexport declare const cornersOf: (b: Box) => Vec2[];\nexport declare function boundsOfBox(b: Box): Rect;\nexport declare function containsPoint(b: Box, p: Vec2, slop?: number): boolean;\nexport declare function handlePoint(b: Box, handle: Handle): Vec2;\nexport type ResizeOptions = {\n    keepAspect?: boolean;\n    fromCenter?: boolean;\n    minW?: number;\n    minH?: number;\n};\nexport declare function resizeBox(b: Box, handle: Handle, pointer: Vec2, o?: ResizeOptions): Box;\nexport declare function scaleBoxes<T extends Box>(boxes: readonly T[], from: Rect, to: Rect): T[];\nexport declare function rotateBoxes<T extends Box>(boxes: readonly T[], about: Vec2, degrees: number): T[];\nexport declare function snapAngle(degrees: number, steps: boolean): number;\nexport declare function resizeCursor(handle: Handle, rotation: number): string;"
        },
        {
          "file": "handles.ts",
          "declarations": "import type { Vec2 } from './camera';\nimport { type Box, type Handle } from './geometry';\nexport declare const HANDLE_SIZE = 9;\nexport declare const ROTATE_OFFSET = 20;\nexport type HandleHit = {\n    kind: 'resize';\n    handle: Handle;\n} | {\n    kind: 'rotate';\n};\nexport type HandleLayout = {\n    corners: Vec2[];\n    handles: {\n        handle: Handle;\n        at: Vec2;\n    }[];\n    knob: Vec2 | null;\n    small: boolean;\n    rotation: number;\n};\nexport declare function layoutHandles(box: Box, handles: readonly Handle[], rotatable: boolean, toScreen: (p: Vec2) => Vec2): HandleLayout;\nexport declare function pickHandle(layout: HandleLayout, p: Vec2): HandleHit | null;"
        },
        {
          "file": "snap.ts",
          "declarations": "import type { Rect } from './camera';\nexport type Guide = {\n    axis: 'x' | 'y';\n    pos: number;\n    from: number;\n    to: number;\n};\nexport declare class SnapTargets {\n    readonly rects: readonly Rect[];\n    constructor(rects: readonly Rect[]);\n    nearest(axis: 'x' | 'y', values: readonly number[], threshold: number): number | null;\n    guides(axis: 'x' | 'y', values: readonly number[], moving: Rect): Guide[];\n}\nexport declare function snapMove(moving: Rect, targets: SnapTargets, threshold: number): {\n    dx: number;\n    dy: number;\n    guides: Guide[];\n};\nexport declare function snapResize(r: Rect, ex: number, ey: number, targets: SnapTargets, threshold: number): {\n    rect: Rect;\n    guides: Guide[];\n};"
        },
        {
          "file": "spacing.ts",
          "declarations": "import type { Rect } from './camera';\nimport { type Guide, type SnapTargets } from './snap';\ntype Axis = 'x' | 'y';\nexport type Gap = {\n    axis: Axis;\n    from: number;\n    to: number;\n    at: number;\n};\nexport declare function spacingShift(axis: Axis, moving: Rect, others: readonly Rect[], threshold: number): number | null;\nexport declare function equalGaps(axis: Axis, moving: Rect, others: readonly Rect[], tolerance?: number): Gap[];\nexport type SmartSnap = {\n    dx: number;\n    dy: number;\n    guides: Guide[];\n    gaps: Gap[];\n};\nexport declare function smartSnap(moving: Rect, targets: SnapTargets, threshold: number, spacing?: boolean): SmartSnap;\nexport declare function measure(a: Rect, b: Rect): Gap[];\nexport {};"
        }
      ],
      "pitfalls": [
        "The snap reach is in screen pixels",
        "Build SnapTargets once when a drag starts, from everything but the moving items",
        "Snap the raw offset from the drag’s start, never the last snapped position",
        "Turned items snap by their axis-aligned bounds (boundsOfBox)",
        "Resize from the box as it was when the drag started, not as it is now",
        "Hit-test handles before shapes, and the shapes topmost first",
        "With a group selected, scale and turn the boxes as they were at the drag’s start"
      ],
      "card": "entries/smart-guides.json"
    },
    {
      "id": "splash-paint",
      "aliases": [],
      "name": "Living paint behind the UI",
      "summary": "A stable-fluids simulation in WebGPU compute, nothing read back, with the page’s own panels as obstacles the paint flows round and a moving panel pushing it aside. Shaded as soft, grainy Holi powder on warm paper or glossy liquid paint on a dark floor; poured by dragging, burst by clicking or from code. Panels that share a membrane are drawn as one soft body of paint, joined by a neck that thins and breaks as they part. It rests: it steps only while something stirs it and then draws nothing at all. Without WebGPU the same runs on WebGL2.",
      "category": "simulation",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "fluid",
        "stable fluids",
        "compute",
        "wgsl",
        "raw webgpu",
        "dom + gpu",
        "obstacles",
        "resting",
        "paint",
        "background",
        "webgl2 fallback",
        "no dependencies"
      ],
      "useCases": [
        "hero and landing pages",
        "splash and welcome screens",
        "creative and playful apps",
        "empty states and onboarding",
        "celebrations after an action",
        "interactive backgrounds behind cards"
      ],
      "interaction": "Drag to pour · click to burst · drag a card by its handle",
      "kits": [],
      "pairsWith": [
        {
          "id": "metaball-liquid",
          "why": "Drops beside the paint"
        },
        {
          "id": "effects-switchboard",
          "why": "Let people still the paint"
        },
        {
          "id": "capability-tiers",
          "why": "A still backdrop on weak GPUs"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0 AND MIT",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "ambient",
          "in": "module",
          "values": {
            "strict": false,
            "refined": false,
            "playful": true
          },
          "note": "jets of colour wandering round the edges"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 3.73,
          "cpuMs": 0.115,
          "cpuP95Ms": 0.175,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the ambient jets on and a burst every 1.5 s, so the paint steps every frame: a 256 × 144 motion grid (curl, velocity with three panel obstacles, divergence, 21 pressure passes, gradient), the colour advected on 1024 × 576 and a quarter-size glow, then the full-screen powder shading with the panels’ shadows and their membrane, timed with timestamp queries. At rest it draws nothing."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.245,
          "cpuMs": 0.235,
          "cpuP95Ms": 0.365,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.67,
            "p99Ms": 18,
            "low1Fps": 54.2
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 501 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 9.619,
          "cpuMs": 0.26,
          "cpuP95Ms": 0.34,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 1313 ms."
        }
      ],
      "signatures": [
        {
          "file": "splash-paint.ts",
          "declarations": "import { type Colour, type Grids, type Knobs, type Obstacle } from './splash-logic';\nexport type SplashLook = 'powder' | 'paint';\nexport type SplashOptions = {\n    look?: SplashLook;\n    palette?: readonly Colour[];\n    quality?: Partial<Knobs>;\n    ambient?: boolean;\n    ground?: boolean;\n    shadows?: number;\n    membranes?: boolean;\n    membraneReach?: number;\n    pointer?: HTMLElement | null;\n    motion?: boolean;\n    loop?: boolean;\n    maxPixelRatio?: number;\n    backend?: 'auto' | 'webgpu' | 'webgl2';\n};\nexport type BurstOptions = {\n    ring?: number;\n    radius?: number;\n    force?: number;\n    amount?: number;\n    colours?: readonly Colour[];\n    spin?: number;\n    spread?: number;\n};\nexport type SplashPaint = {\n    frame(): boolean;\n    splat(x: number, y: number, vx: number, vy: number, colour?: Colour | null, opts?: {\n        radius?: number;\n        amount?: number;\n    }): void;\n    burst(x: number, y: number, opts?: BurstOptions): void;\n    stir(seconds?: number): void;\n    clear(): void;\n    setObstacles(list: readonly Obstacle[]): void;\n    watchObstacles(host: HTMLElement, selector?: string): () => void;\n    setLook(look: SplashLook): void;\n    setPalette(colours: readonly Colour[]): void;\n    setQuality(knobs: Partial<Knobs>): void;\n    setAmbient(on: boolean): void;\n    setMotion(on: boolean): void;\n    setMembranes(on: boolean): void;\n    resize(): void;\n    pause(): void;\n    resume(): void;\n    readonly awake: boolean;\n    readonly quality: Knobs;\n    readonly grids: Grids | null;\n    gpuMs(): number | null;\n    readonly backend: 'webgpu' | 'webgl2';\n    dispose(): void;\n};\nexport type PaintGpu = {\n    readonly backend: 'webgpu' | 'webgl2';\n    build(sizes: Grids, carry: boolean, u: Float32Array): void;\n    draw(u: Float32Array, splats: Float32Array, n: number, step: boolean, iterations: number): void;\n    readonly inFlight: boolean;\n    rest(): void;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare function createSplashPaint(canvas: HTMLCanvasElement, options?: SplashOptions): Promise<SplashPaint | null>;"
        }
      ],
      "pitfalls": [
        "Put the canvas behind the page (`position: absolute; inset: 0`) with `pointer-events: none`",
        "Obstacles are in the canvas’s CSS px from its top left",
        "watchObstacles re-reads on resizes, scrolls and style or class changes of the marked elements",
        "A corner radius is read once per element and cached until the element resizes",
        "At most 32 obstacles and 96 splats a step",
        "It rests three seconds after the last stir and then draws nothing",
        "A new grid size (the Motion grid or Paint detail knob, or a canvas of another shape) rebuilds…",
        "Without WebGPU it runs on WebGL2 (splash-gl.ts)",
        "Reduced motion slows the paint, softens bursts and turns the jets off"
      ],
      "card": "entries/splash-paint.json"
    },
    {
      "id": "split-flap-board",
      "aliases": [],
      "name": "Split-flap board",
      "summary": "A three-piece GPU flap drum for text, countdown digits and pictures quantised to colour shades. Staggered starts, falling reverse faces, reusable instance buffers and final-text DOM announcements, with immediate reduced-motion changes and WebGL2 fallback.",
      "category": "technique",
      "role": "hero-visual",
      "stack": [
        "three",
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "split flap",
        "departures",
        "countdown",
        "picture",
        "letters",
        "drum",
        "instancing",
        "TSL",
        "reduced motion",
        "screen reader"
      ],
      "useCases": [
        "a departures board in an event foyer",
        "a countdown to an opening",
        "an animated typographic title",
        "a low-resolution picture on colour flaps"
      ],
      "interaction": null,
      "kits": [],
      "pairsWith": [
        {
          "id": "camera-director",
          "why": "Frame the board in a larger foyer or title scene."
        },
        {
          "id": "capability-tiers",
          "why": "Choose a smaller grid on weaker devices."
        },
        {
          "id": "micro-interactions",
          "why": "Use its small DOM digit flap when a 3D board is unnecessary."
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": "r187",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "stagger",
          "in": "module",
          "values": {
            "strict": 0,
            "refined": 0.018,
            "playful": 0.05
          },
          "note": "Seconds of delay per column, with a smaller row offset."
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 0.285,
          "cpuMs": 0.18,
          "cpuP95Ms": 0.27,
          "badge": "light",
          "drawCalls": 5,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.37,
            "p99Ms": 6.125,
            "low1Fps": 144.9
          },
          "notes": "80 cells: three instanced flap draws and a housing, caller-driven text transitions every five seconds. The isolated benchmark constructs no foyer or visible demo controls and does not attach DOM output."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "intel xe-2lpg",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Microsoft Edge 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 1.049,
          "cpuMs": 0.215,
          "cpuP95Ms": 0.375,
          "badge": "moderate",
          "drawCalls": 7,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Microsoft Edge 157, Chromium 157 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 312 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 1.07,
          "cpuMs": 0.06,
          "cpuP95Ms": 0.1,
          "badge": "moderate",
          "drawCalls": 7,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 222 ms."
        }
      ],
      "signatures": [
        {
          "file": "split-flap-board.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { type Pixels } from './model';\nimport './style.css';\nexport { DEFAULT_DRUM } from './model';\nexport type BoardOptions = {\n    accessibilityHost: HTMLElement;\n    rows?: number;\n    columns?: number;\n    drum?: string;\n    flipSpeed?: number;\n    stagger?: number;\n    ink?: THREE.ColorRepresentation;\n    face?: THREE.ColorRepresentation;\n    housing?: THREE.ColorRepresentation;\n    shades?: readonly THREE.ColorRepresentation[];\n    font?: string;\n    reducedMotion?: boolean;\n};\nexport declare function createSplitFlapBoard(options: BoardOptions): {\n    group: THREE.Group<THREE.Object3DEventMap>;\n    width: number;\n    height: number;\n    readonly busy: boolean;\n    readonly text: string;\n    showText(value: string, announce?: boolean): void;\n    showCountdown(seconds: number, announce?: boolean): void;\n    showPicture(image: Pixels, description: string): void;\n    update(dtSeconds: number): void;\n    setTiming(flipSpeed: number, stagger: number): void;\n    setReducedMotion(reduced: boolean): void;\n    setColours(value: Pick<BoardOptions, \"ink\" | \"face\" | \"housing\">): void;\n    dispose(): void;\n};"
        }
      ],
      "pitfalls": [
        "Rows (1–32), columns (1–64), drum and picture shades are construction-time choices",
        "Call update(dtSeconds) from your own loop. flipSpeed is 2–40 flaps per second",
        "An update arriving mid-transition replaces the single pending target",
        "showCountdown accepts remaining seconds (0–5999), rounded up, displayed as mm:ss",
        "showPicture accepts RGBA pixel data of at most one megapixel and a required description",
        "Pass an accessibilityHost in the DOM and keep the module stylesheet",
        "The group is centred at the origin, faces +Z and uses Y up",
        "Three instanced flap draws plus one housing",
        "Dispose removes the group and accessible DOM and frees owned geometry, materials and textures"
      ],
      "card": "entries/split-flap-board.json"
    },
    {
      "id": "split-panes",
      "aliases": [],
      "name": "Split panes and docking tab groups",
      "summary": "The layout of every editor, from a JSON tree you can save and restore. Splits side by side or stacked, nested to any depth, each pane with a minimum and maximum in pixels or percent, a fixed-pixel sidebar that stays put while the rest share the room, and a collapse that snaps shut past half the minimum (or on a double-click, or Enter). Panes hold tab groups: drag a tab onto another pane’s edge or centre to split or join, with a drop indicator; reorder and close tabs; an emptied group goes away. Dividers are WAI-ARIA window splitters, every docking move is in a keyboard menu, and a drag writes once a frame without reading the layout back.",
      "category": "ui",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "split panes",
        "resizable",
        "splitter",
        "docking",
        "tab groups",
        "window splitter",
        "tabs",
        "layout tree",
        "json",
        "collapse",
        "drag and drop",
        "accessibility",
        "keyboard",
        "touch",
        "rtl",
        "dom",
        "css",
        "no dependencies"
      ],
      "useCases": [
        "code and text editors",
        "design and creative tools",
        "admin consoles with a sidebar and a detail panel",
        "mail and chat: list, message, details",
        "dashboards people arrange themselves",
        "any page with a resizable sidebar"
      ],
      "interaction": "Drag a divider or a tab · double-click a divider to collapse · Shift+F10 on a tab for every move · F6 between panes",
      "kits": [
        {
          "kit": "foundations",
          "as": "optional"
        },
        {
          "kit": "dashboard",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "tree-view",
          "why": "The file tree in a side pane"
        },
        {
          "id": "property-panel",
          "why": "The inspector in a docked pane"
        },
        {
          "id": "keyboard-shortcuts",
          "why": "Move focus between panes by key"
        }
      ],
      "variants": [],
      "version": "1.0.3",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0.05,
          "cpuP95Ms": 0.125,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the demo driving itself on the editor layout: for two seconds of every three the Files divider is dragged back and forth with real pointer events (one measure of the tree and only the changed flex-grow writes per frame), then the Preview tab is docked into the editor group and split back out beside it, and the bottom panel collapses and expands. Nothing runs between steps: at rest the panes cost nothing."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.04,
          "cpuP95Ms": 0.095,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 62 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.02,
          "cpuP95Ms": 0.1,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 68 ms."
        }
      ],
      "signatures": [
        {
          "file": "split-panes.ts",
          "declarations": "import { type DockTarget, type LayoutNode } from './tree';\nexport type Change = {\n    type: 'resize' | 'collapse' | 'expand' | 'dock' | 'close' | 'activate';\n    node?: string;\n    tab?: string;\n};\nexport type Phase = 'menu-open' | 'menu-close' | 'collapse' | 'expand';\nexport type Strings = {\n    tabActions: string;\n    close: string;\n    empty: string;\n    split: string;\n    splitLeft: string;\n    splitRight: string;\n    splitUp: string;\n    splitDown: string;\n    moveTo: string;\n    edge: string;\n    edgeLeft: string;\n    edgeRight: string;\n    edgeTop: string;\n    edgeBottom: string;\n    order: string;\n    earlier: string;\n    later: string;\n    collapsed: string;\n    group: (titles: string[]) => string;\n    moved: (title: string, others: string[]) => string;\n    closed: (title: string) => string;\n    collapsedSaid: (name: string) => string;\n    expandedSaid: (name: string) => string;\n};\nexport declare const STRINGS: Strings;\nexport type TabState = {\n    selected: boolean;\n    closable: boolean;\n    locked: boolean;\n};\nexport type SplitPanesOptions = {\n    layout: LayoutNode;\n    render: (tab: string) => Node;\n    title: (tab: string) => string;\n    icon?: (tab: string) => Node | null | undefined;\n    renderTab?: (el: HTMLElement, tab: string, state: TabState) => void;\n    closable?: (tab: string) => boolean;\n    beforeClose?: (tab: string) => boolean | Promise<boolean>;\n    unmount?: (tab: string, content: Node) => void;\n    tabs?: boolean;\n    controlled?: boolean;\n    gutter?: number;\n    step?: number;\n    strings?: Partial<Strings>;\n    reducedMotion?: boolean;\n    animate?: (el: HTMLElement, phase: Phase) => Promise<unknown> | void;\n    onChange?: (layout: LayoutNode, change: Change) => void;\n};\nexport type SplitPanes = {\n    readonly root: HTMLElement;\n    readonly layout: LayoutNode;\n    setLayout(layout: LayoutNode): void;\n    open(tab: string, target?: DockTarget): void;\n    dock(tab: string, target: DockTarget): void;\n    close(tab: string): void;\n    collapse(id: string, collapsed?: boolean): void;\n    focus(tab?: string): void;\n    content(tab: string): Node | undefined;\n    refresh(): void;\n    destroy(): void;\n};\nexport declare function createSplitPanes(host: HTMLElement, options: SplitPanesOptions): SplitPanes;"
        },
        {
          "file": "tree.ts",
          "declarations": "export type Length = number | `${number}%`;\nexport type Slot = {\n    size?: number;\n    fixed?: boolean;\n    min?: Length;\n    max?: Length;\n    collapsible?: boolean;\n    collapsed?: boolean;\n};\ntype Base = Slot & {\n    id: string;\n    label?: string;\n};\nexport type GroupNode = Base & {\n    type: 'group';\n    tabs: string[];\n    active?: string;\n    locked?: boolean;\n    keep?: boolean;\n};\nexport type SplitNode = Base & {\n    type: 'split';\n    dir: 'row' | 'column';\n    children: LayoutNode[];\n};\nexport type LayoutNode = GroupNode | SplitNode;\nexport type Edge = 'center' | 'start' | 'end' | 'top' | 'bottom';\nexport type DockTarget = {\n    node: string;\n    edge?: Edge;\n    index?: number;\n    share?: number;\n};\nexport declare const isSplit: (n: LayoutNode) => n is SplitNode;\nexport declare function walk(node: LayoutNode, visit: (n: LayoutNode, parent: SplitNode | null, index: number) => void, parent?: SplitNode | null, index?: number): void;\nexport declare function find(root: LayoutNode, id: string): LayoutNode | undefined;\nexport declare function parentOf(root: LayoutNode, id: string): SplitNode | null;\nexport declare function groups(root: LayoutNode): GroupNode[];\nexport declare function groupOf(root: LayoutNode, tab: string): GroupNode | undefined;\nexport declare function allTabs(root: LayoutNode): string[];\nexport declare function nextId(root: LayoutNode, prefix: string): string;\nexport declare function replace(node: LayoutNode, id: string, fn: (n: LayoutNode) => LayoutNode): LayoutNode;\nexport declare function normalise(root: LayoutNode): LayoutNode;\nexport declare function dock(root: LayoutNode, tab: string, target: DockTarget, ids?: {\n    group?: string;\n    split?: string;\n}): LayoutNode;\nexport declare function close(root: LayoutNode, tab: string): LayoutNode;\nexport declare function activate(root: LayoutNode, tab: string): LayoutNode;\nexport declare function collapse(root: LayoutNode, id: string, collapsed?: boolean): LayoutNode;\nexport declare function applySizes(root: LayoutNode, splitId: string, start: number[], px: number[]): LayoutNode;\nexport declare function parseLayout(input: unknown): LayoutNode;\nexport {};"
        }
      ],
      "pitfalls": [
        "The host needs a size: the panes fill it (100% of its width and height)",
        "A tab’s content is made once, on first show, and then moved, never remade",
        "Keep at least one flexible pane in every split",
        "A fixed pane’s size is in CSS pixels and a share is a fraction",
        "Controlled use (controlled: true) shows nothing new until you call setLayout with the layout…",
        "The tab strip scrolls sideways on touch, so a touch drag starts with a short hold (350 ms)",
        "Tab ids and node ids become parts of element ids",
        "Without the plain look (split-panes.css) the panes still work and stay accessible"
      ],
      "card": "entries/split-panes.json"
    },
    {
      "id": "static-merge",
      "aliases": [],
      "name": "Static merge with moving anchors",
      "summary": "Merge rigid parts by material identity, or opt in to vertex-baked standard materials so different colours and PBR finishes share draws. Moving anchors carry their merged descendants; reflected parts keep their front faces. Originals remain for picking and restoration. The windmill yard compares 147 separate draws with two baked draws while its sails move.",
      "category": "technique",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "calm",
      "tags": [
        "batching",
        "merge",
        "draw calls",
        "static geometry",
        "moving anchors",
        "mirrored",
        "picking",
        "three.js",
        "webgpu",
        "webgl"
      ],
      "useCases": [
        "machines and props assembled from many different rigid parts",
        "merging static building geometry within a culling cell",
        "keeping a moving wheel or hinge attached to a merged assembly",
        "reducing draws while retaining original object identities for picking"
      ],
      "interaction": "Switch Join static parts to see many colours become a few · drag to orbit · click a piece to identify it",
      "kits": [],
      "pairsWith": [
        {
          "id": "auto-instancer",
          "why": "Instances repeated geometry; this merges different geometry. Give them separate roots or disjoint sets of sources"
        },
        {
          "id": "compile-without-stalls",
          "why": "Compile generated geometry before the first visible frame after rebuilding"
        },
        {
          "id": "gpu-memory-ledger",
          "why": "Track the extra baked vertex buffers alongside the originals retained for picking"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 0.407,
          "cpuMs": 0.265,
          "cpuP95Ms": 0.385,
          "badge": "light",
          "drawCalls": 6,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.272,
            "p99Ms": 6.635,
            "low1Fps": 142.9
          },
          "notes": "A windmill yard made of individually named rigid parts, with one moving sail anchor and a fitted sun shadow. Merging and draw colours are enabled initially. Both representations, normal/draw colours, shadow passes and the selection tint are warmed before interaction. Card counts cover the yard’s main-view draws only, not the surrounding ground, shadow pass or selection overlay; they are not timing measurements."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "intel xe-2lpg",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Microsoft Edge 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 1.507,
          "cpuMs": 0.525,
          "cpuP95Ms": 0.835,
          "badge": "moderate",
          "drawCalls": 6,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Microsoft Edge 157, Chromium 157 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 379 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 3.175,
          "cpuMs": 0.65,
          "cpuP95Ms": 1,
          "badge": "heavy",
          "drawCalls": 6,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 777 ms."
        }
      ],
      "signatures": [
        {
          "file": "static-merge.ts",
          "declarations": "import { Mesh, type Intersection, type Object3D, type Raycaster } from 'three';\nexport declare const DYNAMIC_FLAG = \"staticMergeDynamic\";\nexport type StaticMergeOptions = {\n    bakeMaterials?: boolean;\n    anchors?: ReadonlySet<Object3D>;\n    dynamic?: (mesh: Mesh) => boolean;\n    onDrawnMerged?: (mesh: Mesh, merged: boolean) => void;\n};\nexport type StaticMerge = {\n    readonly merged: readonly Mesh[];\n    readonly consumed: readonly Mesh[];\n    readonly skipped: readonly {\n        mesh: Mesh;\n        reason: string;\n    }[];\n    readonly enabled: boolean;\n    setEnabled(on: boolean): void;\n    pick(raycaster: Raycaster): Intersection[];\n    dispose(): void;\n};\nexport declare function createStaticMerge(root: Object3D, options?: StaticMergeOptions): StaticMerge;"
        }
      ],
      "pitfalls": [
        "A bake is a snapshot: move only the root and declared anchors",
        "Keep culling local: one merger per compact assembly or world cell",
        "Default grouping uses material identity and vertex layout, preserving textures and shader state",
        "Material baking is deliberately narrow",
        "The baked option requires three r187 WebGPURenderer, with native WebGPU or its WebGL2 backend",
        "Object-dependent shading cannot be baked blindly",
        "Originals stay visible in the hierarchy but use layer mask zero while merged",
        "Skip means keep drawing separately",
        "Dispose restores original layers and frees generated geometry plus any generated baked node…",
        "Counts are not a timing result"
      ],
      "card": "entries/static-merge.json"
    },
    {
      "id": "steady-fields",
      "aliases": [
        "range-fields"
      ],
      "name": "Form fields, sliders, steppers and ranges",
      "summary": "Form fields that behave: a draft kept apart from the store (typing never fights a re-render, Esc puts it back, an emptied name comes back), messages tied to their fields and an error summary on submit, numbers typed as 1 234,5 or 1,234.5, a slider whose range never chases its value, a free-word field that suggests (words used here first) and never assumes, and a settings panel built from a list of knobs with reset to recommended. For numbers people nudge: a stepper (a spinbutton between − and +, its unit beside it, a held button repeating faster the longer it is held, a typed value brought into range with a note that says so) and a range with two thumbs that stop at each other instead of crossing, a press on the track taking the nearer, boxes for typing either end and an optional histogram of what the range holds. Plain DOM, no dependencies; restyle it through its parts.",
      "category": "ui",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "forms",
        "validation",
        "error summary",
        "slider",
        "log scale",
        "number input",
        "locale",
        "settings panel",
        "combobox",
        "suggestions",
        "free word",
        "stepper",
        "spinbutton",
        "units",
        "range slider",
        "two thumbs",
        "multi-thumb slider",
        "price filter",
        "histogram",
        "hold to repeat",
        "keyboard",
        "accessibility",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "inspectors and property panels",
        "profile and account forms",
        "settings and tuning panels",
        "number entry in any locale",
        "controlled inputs bound to a store or a CRDT",
        "a word the person chooses: a unit, a category, what a group is called",
        "a price, size or date-span filter in a shop or a search",
        "guests, quantities, nights and seats",
        "a measurement with its unit (kg, m², minutes)"
      ],
      "interaction": "Empty a field, type, press Esc · Fill with mistakes, then Save · drag, type or double-click a knob · tick Ships in groups and name the group · drag either price thumb, or hold + or −",
      "kits": [
        {
          "kit": "foundations",
          "as": "core"
        },
        {
          "kit": "shop",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "accessible-dialog",
          "why": "Forms in a dialog or sheet"
        },
        {
          "id": "date-picker",
          "why": "Its date field"
        },
        {
          "id": "labelled-undo",
          "why": "Undo a committed field by name"
        },
        {
          "id": "data-table",
          "why": "A range or a count filtering the rows"
        }
      ],
      "variants": [],
      "version": "1.3.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-17",
          "gpuMs": null,
          "cpuMs": 0.5,
          "cpuP95Ms": 1.335,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.828,
            "p99Ms": 18.005,
            "low1Fps": 55.1
          },
          "notes": "Measured exercising itself: each frame types a character into the display name (draft, live store, validation), every fourth frame moves a knob (slider, panel, preview), the form is submitted and cleared in turn, and both thumbs of the price range move every frame (histogram and match count following) with the guests stepper stepped every few frames. Idle, nothing runs."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.472,
          "cpuP95Ms": 1.33,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 52 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.3,
          "cpuP95Ms": 1.44,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 406 ms."
        }
      ],
      "signatures": [
        {
          "file": "field.ts",
          "declarations": "import { type FieldOptions, type NumberRules } from './fieldModel';\nimport type { Marks } from './sliderModel';\nexport type SteadyFieldOptions = FieldOptions & {\n    read: () => string;\n    commit: (text: string) => void;\n    onRestore?: (was: string) => void;\n    onDraft?: (draft: string | null) => void;\n    isolateKeys?: boolean;\n};\nexport type SteadyField = {\n    refresh(): void;\n    readonly draft: string | null;\n    keep(): void;\n    dispose(): void;\n};\nexport declare function steadyField(input: HTMLInputElement | HTMLTextAreaElement, o: SteadyFieldOptions): SteadyField;\nexport type NumberFieldOptions = Omit<SteadyFieldOptions, 'read' | 'commit' | 'valid'> & NumberRules & {\n    read: () => number | null;\n    commit: (n: number | null) => void;\n    marks?: Marks;\n    valid?: (text: string) => boolean;\n};\nexport declare function numberField(input: HTMLInputElement, o: NumberFieldOptions): SteadyField & {\n    setMarks(m: Marks): void;\n};"
        },
        {
          "file": "fieldModel.ts",
          "declarations": "import { type Marks } from './sliderModel';\nexport type FieldOptions = {\n    valid?: (text: string) => boolean;\n    live?: boolean;\n    invalid?: 'revert' | 'keep';\n};\nexport type FieldState = {\n    draft: string | null;\n    was: string | null;\n    edited?: boolean;\n};\nexport declare const idle: FieldState;\nexport type FieldStep = {\n    state: FieldState;\n    store: string | null;\n    restored?: boolean;\n};\nexport declare const shownText: (s: FieldState, stored: string) => string;\nexport declare const enter: (stored: string) => FieldState;\nexport declare function typed(s: FieldState, text: string, stored: string, o?: FieldOptions): FieldStep;\nexport declare function left(s: FieldState, stored: string, o?: FieldOptions): FieldStep;\nexport declare function cancelled(s: FieldState, stored: string): FieldStep;\nexport declare function selectionAfterRefresh(old: string, start: number | null, end: number | null, next: string): [\n    number,\n    number\n] | null;\nexport declare const aName: (text: string) => boolean;\nexport type NumberRules = {\n    min?: number;\n    max?: number;\n    integer?: boolean;\n    allowEmpty?: boolean;\n};\nexport declare function numberText(r: NumberRules, marks?: Marks): {\n    valid: (t: string) => boolean;\n    read: (t: string) => number | null;\n    show: (n: number | null) => string;\n};"
        },
        {
          "file": "form.ts",
          "declarations": "import { type Rule } from './validate';\nexport type FormField = {\n    input: HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;\n    label: string;\n    rules: readonly Rule[];\n};\nexport type FormOptions = {\n    fields: FormField[];\n    summary: HTMLElement;\n    headingLevel?: 2 | 3 | 4;\n    onSubmit?: (values: Record<string, string>) => void;\n    checkOnLeave?: boolean;\n};\nexport type ValidatedForm = {\n    validate(): boolean;\n    submit(): void;\n    clear(): void;\n    dispose(): void;\n};\nexport declare function validatedForm(form: HTMLFormElement, o: FormOptions): ValidatedForm;"
        },
        {
          "file": "knobPanel.ts",
          "declarations": "import { type Knob, type KnobValues } from './knobs';\nimport { type Slider } from './slider';\nimport { type Marks } from './sliderModel';\nexport type KnobStorage = {\n    load(): unknown;\n    save(values: KnobValues): boolean;\n};\nexport declare function localKnobStorage(key: string): KnobStorage;\nexport type KnobPanelOptions = {\n    title: string;\n    knobs: readonly Knob[];\n    storage?: KnobStorage | null;\n    onChange?: (values: KnobValues, key: string | null) => void;\n    marks?: Marks;\n    headingLevel?: 2 | 3 | 4;\n};\nexport type KnobPanel = {\n    readonly el: HTMLElement;\n    readonly values: KnobValues;\n    set(values: Partial<KnobValues>): void;\n    reset(id?: string): void;\n    setMarks(m: Marks): void;\n    slider(id: string): Slider | undefined;\n    dispose(): void;\n};\nexport declare function knobPanel(host: HTMLElement, o: KnobPanelOptions): KnobPanel;"
        },
        {
          "file": "range-slider.ts",
          "declarations": "import { type SliderRange } from './sliderModel';\nimport { type Pair, type Thumb } from './range-model';\nexport type RangeSliderOptions = {\n    label: string;\n    range: SliderRange;\n    value: Pair;\n    minGap?: number;\n    unit?: string;\n    unitFirst?: boolean;\n    locale?: string;\n    thumbLabels?: [\n        string,\n        string\n    ];\n    histogram?: readonly number[];\n    boxes?: boolean;\n    onChange?: (value: Pair, how: {\n        final: boolean;\n        thumb: Thumb;\n    }) => void;\n};\nexport type RangeSlider = {\n    readonly element: HTMLElement;\n    readonly value: Pair;\n    set(value: Pair): void;\n    setHistogram(counts: readonly number[] | null): void;\n    dispose(): void;\n};\nexport declare function rangeSlider(host: HTMLElement, o: RangeSliderOptions): RangeSlider;"
        },
        {
          "file": "slider.ts",
          "declarations": "import { type Marks, type SliderRange } from './sliderModel';\nexport type SliderOptions = {\n    label: string;\n    value: number;\n    range: SliderRange;\n    onChange: (v: number) => void;\n    unit?: string;\n    marks?: Marks;\n    onReset?: () => void;\n    onRange?: (r: SliderRange) => void;\n    describedBy?: string;\n    onGestureStart?: () => void;\n    onGestureEnd?: () => void;\n};\nexport type Slider = {\n    readonly el: HTMLElement;\n    readonly value: number;\n    readonly range: SliderRange;\n    set(v: number): void;\n    setRange(r: SliderRange): void;\n    setMarks(m: Marks): void;\n    setDisabled(off: boolean): void;\n    dispose(): void;\n};\nexport declare function slider(host: HTMLElement, o: SliderOptions): Slider;"
        },
        {
          "file": "sliderModel.ts",
          "declarations": "export type SliderRange = {\n    min: number;\n    max: number;\n    step?: number;\n    log?: boolean;\n};\nexport type Marks = {\n    decimal: '.' | ',';\n    group: string;\n};\nexport declare function toPosition(v: number, r: SliderRange): number;\nexport declare function fromPosition(p: number, r: SliderRange): number;\nexport declare function snap(v: number, r: SliderRange): number;\nexport declare function autoStep(r: SliderRange): number;\nexport declare function outOfRange(v: number, r: SliderRange): -1 | 0 | 1;\nexport declare function keyStep(v: number, r: SliderRange, key: string, shift: boolean): number | null;\nexport declare function readTyped(text: string, marks?: Marks): number | null;\nexport declare function formatIn(n: number, step: number, marks: Marks): string;\nexport declare function marksOf(locale?: string): Marks;\nexport declare function niceUp(v: number): number;\nexport declare function niceDown(v: number): number;\nexport declare function defaultRange(v: number, kind?: 'number' | 'percent'): SliderRange;\nexport declare function extendRange(r: SliderRange, v: number): SliderRange;\nexport declare function cleanRange(r: SliderRange): SliderRange;"
        },
        {
          "file": "stepper.ts",
          "declarations": "export type StepperOptions = {\n    label: string;\n    labelledBy?: string;\n    value: number;\n    min?: number;\n    max?: number;\n    step?: number;\n    bigStep?: number;\n    unit?: string;\n    unitFirst?: boolean;\n    locale?: string;\n    decreaseLabel?: string;\n    increaseLabel?: string;\n    onChange?: (value: number) => void;\n};\nexport type Stepper = {\n    readonly element: HTMLElement;\n    readonly value: number;\n    set(value: number): void;\n    dispose(): void;\n};\nexport declare function stepper(host: HTMLElement, o: StepperOptions): Stepper;"
        },
        {
          "file": "validate.ts",
          "declarations": "import { type Marks } from './sliderModel';\nexport type Rule = (text: string) => string | null;\nexport declare const check: (text: string, rules: readonly Rule[]) => string | null;\nexport declare const passes: (rules: readonly Rule[]) => (text: string) => boolean;\nexport declare const rules: {\n    required: (message?: string) => Rule;\n    minLength: (n: number, message?: string) => Rule;\n    maxLength: (n: number, message?: string) => Rule;\n    pattern: (re: RegExp, message: string) => Rule;\n    email: (message?: string) => Rule;\n    number: (o: {\n        min?: number;\n        max?: number;\n        integer?: boolean;\n        unit?: string;\n    }, marks?: Marks | (() => Marks)) => Rule;\n};\nexport declare const summaryTitle: (count: number) => string;"
        },
        {
          "file": "wordField.ts",
          "declarations": "import { type SteadyField, type SteadyFieldOptions } from './field';\nexport type WordFieldOptions = Pick<SteadyFieldOptions, 'onDraft' | 'onRestore' | 'isolateKeys'> & {\n    read: () => string;\n    commit: (word: string) => void;\n    used: () => readonly string[];\n    common: readonly string[];\n    hint?: string;\n    limit?: number;\n    live?: boolean;\n    groups?: {\n        used: string;\n        common: string;\n    };\n};\nexport type WordField = SteadyField & {\n    close(): void;\n};\nexport declare function wordField(input: HTMLInputElement, o: WordFieldOptions): WordField;"
        }
      ],
      "pitfalls": [
        "A field that has focus but was never typed in must not store on leaving",
        "Import steady-fields.base.css, then steady-fields.css (or your own look instead)",
        "Call refresh() whenever the store changes, never write input.value yourself",
        "Refresh when the stored text changes, not on every render",
        "Focus and select a new field after its first refresh, not before",
        "Enter keeps a whole name typed in a field with completions",
        "A word the person chooses (a unit, a category, what a group is called) starts empty with a hint",
        "A field that edits stored data and one in a submit form want different rules for a bad draft",
        "Bind steadyField before validatedForm on the same inputs",
        "The summary’s links are real links (#id) but their clicks are handled",
        "Number marks come from the person’s setting or locale (marksOf)",
        "Stored knob values are untrusted",
        "Keys typed in the knob panel and in steady fields stop at them",
        "Two native range inputs stacked on one track look like a two-thumb slider until you press",
        "A thumb that crosses the other swaps which end it is mid-drag",
        "Give each thumb its own name (\"Lowest price a night\", \"Highest price a night\") and its live…",
        "Query on release, not while dragging",
        "Keep the stepper’s buttons out of the tab order (the spinbutton pattern)",
        "A held stepper button repeats only after a pause, so a click is never two steps",
        "Inset the range’s track by half a thumb and its ring at both ends (`--rgf-inset`)"
      ],
      "card": "entries/steady-fields.json"
    },
    {
      "id": "stitched-dom",
      "aliases": [],
      "name": "DOM stitched to GPU cloth",
      "summary": "Real, selectable DOM text riding a cloth simulated on the GPU. A raw-WGSL Verlet solve (Jacobi, from one buffer into the other) carries loads stitched in rest space, and every link keeps a health, so an overloaded panel frays, tears and mends. Probes read the cloth back every frame at each block’s four corners, and each block gets a CSS matrix3d that maps its box onto that patch: cards sag with the day they weigh on, banners sway on a rail, and the text stays text. A CPU twin with the same arithmetic draws on Canvas 2D where WebGPU is missing.",
      "category": "ui",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "cloth",
        "verlet",
        "jacobi",
        "compute",
        "readback",
        "matrix3d",
        "homography",
        "dom + gpu",
        "tearing",
        "raw webgpu",
        "wgsl",
        "drag and drop",
        "cpu fallback",
        "canvas 2d fallback",
        "timestamp queries",
        "no dependencies"
      ],
      "useCases": [
        "a planning board where each column or day sags as deep as it is busy, and tears past its capacity",
        "banners, notices and pull-quotes that hang and sway, and stay selectable, translatable text",
        "a tactile hero or onboarding page where the pointer blows the copy",
        "showing load, stress or overload as something you can feel rather than read",
        "any DOM laid onto a GPU surface: the probe-and-matrix3d pattern works for flags, sails or water too"
      ],
      "interaction": "Drag a card to another day · on the banners, the pointer is air",
      "kits": [],
      "pairsWith": [
        {
          "id": "gpu-cloth",
          "why": "The three.js cloth for scenes"
        },
        {
          "id": "textile-frames",
          "why": "Woven borders in the same cloth language"
        },
        {
          "id": "noren-banners",
          "why": "Curtains and banners in cloth"
        }
      ],
      "variants": [
        {
          "id": "gpu-cloth",
          "note": "In three.js TSL: flags, banners, tarps and nets in wind, torn by shots along a ray; no DOM, no loads, no link health."
        }
      ],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-14",
          "gpuMs": 1.75,
          "cpuMs": 0.215,
          "cpuP95Ms": 0.34,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured on the sheet: 6 panels, 7,865 points, 3 substeps of 15 Jacobi passes a frame, 14 cards read back as 56 probes. A card is moved to another day every 1.2 s, so the cloth never rests and the readback and matrix3d placement run every frame."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 6.947,
          "cpuMs": 0.345,
          "cpuP95Ms": 0.67,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.65,
            "p99Ms": 17.865,
            "low1Fps": 55.6
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 163 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 14.042,
          "cpuMs": 0.24,
          "cpuP95Ms": 0.34,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 519 ms."
        }
      ],
      "signatures": [
        {
          "file": "cloth-spec.ts",
          "declarations": "export declare const FLAG: {\n    readonly pinned: 1;\n    readonly noRight: 2;\n    readonly noDown: 4;\n    readonly hidden: 8;\n};\nexport declare const NO_ANCHOR = 4294967295;\nexport declare const MAX_PANELS = 16;\nexport declare function checkPanels(count: number, what: string): void;\nexport declare const MAX_LOADS = 64;\nexport declare const MAX_PROBES = 1024;\nexport type ClothSpec = {\n    cols: number;\n    rows: number;\n    sp: number;\n    every: number;\n    rest: Float32Array<ArrayBuffer>;\n    meta: Uint32Array<ArrayBuffer>;\n    faces: Uint32Array<ArrayBuffer>;\n    geo: [\n        number,\n        number\n    ];\n};\nexport type Load = {\n    x: number;\n    y: number;\n    z: number;\n    r: number;\n    fx: number;\n    fy: number;\n    fz: number;\n};\nexport type Air = {\n    x: number;\n    y: number;\n    z: number;\n    r: number;\n    vx: number;\n    vy: number;\n    vz: number;\n};\nexport type Tuning = {\n    pre: number;\n    tear: number;\n    gravity: number;\n    damping: number;\n    heal: number;\n    wear: number;\n    strainRef: number;\n    floorY: number | null;\n    light: [\n        number,\n        number,\n        number\n    ];\n};\nexport declare const DEFAULT_TUNING: Tuning;\nexport type SilkLook = {\n    bg: [\n        number,\n        number,\n        number\n    ];\n    silk: [\n        number,\n        number,\n        number\n    ];\n    sheen: number;\n    silk2: [\n        number,\n        number,\n        number\n    ];\n    back: number;\n    thread: [\n        number,\n        number,\n        number\n    ];\n    glow: number;\n    hot: [\n        number,\n        number,\n        number\n    ];\n    fray: [\n        number,\n        number,\n        number\n    ];\n    floor: [\n        number,\n        number,\n        number\n    ];\n    through: number;\n    cardShadow: number;\n    night: number;\n};\nexport declare const SILK_LOOKS: Record<'day' | 'night', SilkLook>;\nexport type Camera = {\n    vp: Float32Array<ArrayBuffer>;\n    eye: [\n        number,\n        number,\n        number\n    ];\n    W: number;\n    H: number;\n};\nexport type ReadCallback = (world: Float32Array, stats: Float32Array) => void;\nexport type ClothEngine = {\n    readonly kind: 'webgpu' | 'cpu';\n    readonly canvas: HTMLCanvasElement;\n    setCloth(spec: ClothSpec): void;\n    setLoads(loads: Load[]): void;\n    setOver(over: ArrayLike<number>): void;\n    setSlack(slack: ArrayLike<number>): void;\n    setAir(air: Air | null): void;\n    setRects(rects: Array<[\n        number,\n        number,\n        number,\n        number\n    ]>): void;\n    setCamera(cam: Camera, mode: 'sheet' | 'banners'): void;\n    setTuning(t: Partial<Tuning>): void;\n    setLook(look: SilkLook): void;\n    setHighlight(panel: number): void;\n    setProbes(colRow: Float32Array): void;\n    onRead(cb: ReadCallback | null): void;\n    settle(steps?: number): void;\n    frame(dt: number): void;\n    gpuMs(): number | null;\n    readonly resting: boolean;\n    dispose(): void;\n};\nexport declare function createRestWatch(after?: number, reads?: number): {\n    wake(): void;\n    tick(dt: number): void;\n    read(stats: ArrayLike<number>): void;\n    readonly resting: boolean;\n};\nexport type SheetOptions = {\n    across: number;\n    deep: number;\n    panelW?: number;\n    panelD?: number;\n    cells?: number;\n};\nexport type Sheet = ClothSpec & {\n    across: number;\n    deep: number;\n    panelW: number;\n    panelD: number;\n    width: number;\n    depth: number;\n    panelOrigin(i: number): [\n        number,\n        number\n    ];\n    panelAt(x: number, z: number): number;\n};\nexport declare function buildSheet({ across, deep, panelW, panelD, cells }: SheetOptions): Sheet;\nexport declare function blockLoad(share: number, x: number, z: number, w: number, d: number, sp: number, use?: number, r?: number): Load;\nexport declare const LOAD_K = 190000;\nexport type BannerOptions = {\n    count: number;\n    width?: number;\n    height?: number;\n    gap?: number;\n    spacing?: number;\n    pleat?: number;\n    pleats?: number;\n};\nexport type Banners = ClothSpec & {\n    count: number;\n    width: number;\n    height: number;\n    across: number;\n    left(b: number): number;\n    toGrid(b: number, u: number, v: number): [\n        number,\n        number\n    ];\n    flat(b: number, u: number, v: number): [\n        number,\n        number,\n        number\n    ];\n};\nexport declare function buildBanners({ count, width, height, gap, spacing, pleat, pleats }: BannerOptions): Banners;\nexport declare function hemLoad(banners: Banners, b: number, force: number, r?: number): Load;"
        },
        {
          "file": "cloth.ts",
          "declarations": "import { type ClothEngine, type SilkLook } from './cloth-spec';\nexport type ClothOptions = {\n    prefer?: 'auto' | 'cpu';\n    maxDpr?: number;\n    look?: SilkLook;\n    onLost?: () => void;\n};\nexport declare function createCloth(host: HTMLElement, { prefer, maxDpr, look, onLost }?: ClothOptions): Promise<ClothEngine>;\nexport * from './cloth-spec';\nexport { perspectiveCamera, project, unproject } from './camera';\nexport { quadMatrix, quadMatrixValues, saneQuad } from './quad-matrix';\nexport { measureFlat, placeStitches, probesOf, stitchRects, type Stitch } from './stitch';"
        },
        {
          "file": "stitch.ts",
          "declarations": "import type { Camera } from './cloth-spec';\ntype V3 = [\n    number,\n    number,\n    number\n];\nexport type Stitch = {\n    el: HTMLElement;\n    w: number;\n    h: number;\n    grid: [\n        number,\n        number\n    ][];\n    flat: V3[];\n};\nexport declare function probesOf(stitches: Stitch[]): Float32Array;\nexport type PlaceOptions = {\n    lift?: (k: number) => number;\n    axis?: 1 | 2;\n};\nexport declare function placeStitches(stitches: Stitch[], world: ArrayLike<number> | null, cam: Camera, { lift, axis }?: PlaceOptions): void;\nexport type FlatRect = {\n    el: HTMLElement;\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n};\nexport declare function measureFlat(container: HTMLElement, blocks: Iterable<HTMLElement>): FlatRect[];\nexport declare function stitchRects(rects: FlatRect[], toCloth: (px: number, py: number) => {\n    grid: [\n        number,\n        number\n    ];\n    flat: V3;\n}): Stitch[];\nexport {};"
        }
      ],
      "pitfalls": [
        "Each substep integrates with dt divided by the substeps",
        "Relax from one buffer into the other (Jacobi), an odd number of passes",
        "The loads are placed in rest space, not where the cloth is now",
        "A torn link still pulls at seven tenths in the solve",
        "The readback is a frame or two behind",
        "A block needs `transform-origin: 0 0` and must sit at its container’s (0, 0)",
        "Measure flat with offsets (measureFlat), not getBoundingClientRect",
        "After re-measuring, place the blocks straight away from the last reading",
        "A patch torn apart under a block can fold its quad inside out",
        "Eight storage buffers is the default per-stage limit",
        "The canvas follows the host through a ResizeObserver",
        "Text on the cloth is drawn at the cloth’s scale",
        "A tear drawn as a plain discard reads as a hard black block",
        "Rest: the engine stops stepping, drawing and reading back once no input changed for 2.5 s and…",
        "Without bloom the night silk’s glow would clip to white"
      ],
      "card": "entries/stitched-dom.json"
    },
    {
      "id": "stone-inlay",
      "aliases": [],
      "name": "Stone inlay: the page as a polished slab",
      "summary": "The whole page becomes one slab of polished stone behind ordinary DOM. Every `[data-stone]` element is a tile set flush with a gold trim, from exact rounded-box distances; any Canvas 2D path you draw into an id mask is inlaid stone, its gold seams and bevels drawn from a jump-flood distance field, so they stay smooth at any size. Seven procedural stones (jade, white marble, malachite, lapis, honey onyx, black marble, red jasper) on a black-and-gold or white marble ground, a studio of softboxes in the polish and a key light that follows the pointer. The stone is baked only where something changed and relit each frame; a loupe draws it again live under the glass, magnified or under UV, crossed polars or X-ray, with a scaled clone of the page in the round window. Raw WebGPU, drawn on demand, with a Canvas 2D view where WebGPU is missing.",
      "category": "surface",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "stone",
        "marble",
        "hardstone inlay",
        "inlay",
        "gold",
        "jump flood",
        "distance field",
        "sdf",
        "rounded box",
        "loupe",
        "magnifier",
        "dom + gpu",
        "polish",
        "reflections",
        "deferred",
        "g-buffer",
        "scissor",
        "raw webgpu",
        "wgsl",
        "canvas 2d fallback",
        "draw on demand",
        "timestamp queries",
        "no dependencies"
      ],
      "useCases": [
        "a luxury or showcase page whose panels are cut from stone",
        "charts and diagrams drawn as inlay: bars, rings and lines of stone set in gold",
        "a collector’s, jeweller’s or museum page with a loupe that reads the fine print",
        "a puzzle or crafting game: pieces dropping into sockets cut in a slab",
        "any page where a Canvas 2D path should become a real material with smooth edges"
      ],
      "interaction": "Move the light · drag across the slab to inlay a line · L for the loupe, M U P X its light, the wheel zooms",
      "kits": [],
      "pairsWith": [
        {
          "id": "capability-tiers",
          "why": "A plain slab where the GPU is weak"
        },
        {
          "id": "textile-frames",
          "why": "Another material for the page’s borders"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "calm",
          "in": "module",
          "values": {
            "strict": true
          },
          "note": "the light jumps instead of easing"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 2.078,
          "cpuMs": 0.565,
          "cpuP95Ms": 0.98,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.815,
            "p99Ms": 18.025,
            "low1Fps": 55.4
          },
          "notes": "Measured with the loupe on in Magnify, the key light and the lens circling the slab, while a line of malachite is inlaid a segment every sixth frame (mask repaint, jump flood, and the bake scissored to that segment); every frame relights the slab from the baked stone and draws the stone under the glass live. Timed by its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 2.228,
          "cpuMs": 1.075,
          "cpuP95Ms": 1.77,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.6,
            "p99Ms": 18.06,
            "low1Fps": 54.6
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 1229 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 3.549,
          "cpuMs": 0.38,
          "cpuP95Ms": 38.7,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 744 ms."
        }
      ],
      "signatures": [
        {
          "file": "loupe.ts",
          "declarations": "import { type Lens } from './inlay-core';\nexport type LoupeOptions = {\n    host: HTMLElement;\n    content: HTMLElement;\n    lens?: Partial<Lens>;\n};\nexport type Loupe = {\n    readonly state: Readonly<Lens>;\n    set(lens: Partial<Lens>): void;\n    refresh(): void;\n    reveals(): string;\n    dispose(): void;\n};\nexport declare function createLoupe({ host, content, lens }: LoupeOptions): Loupe;"
        },
        {
          "file": "stone-inlay.ts",
          "declarations": "import { type Box, type Lens, type StoneName } from './inlay-core';\nexport type StoneLook = {\n    ground: 'black' | 'white';\n    gold: number;\n    specks: number;\n    exposure: number;\n    grain: number;\n    vignette: number;\n};\nexport declare const DEFAULT_LOOK: StoneLook;\nexport type ShapeOptions = {\n    seed?: number;\n    lift?: number;\n    stroke?: number;\n};\nexport type InlayPainter = (g: {\n    shape(path: Path2D | string, stone: StoneName, options?: ShapeOptions): void;\n}) => void;\nexport type StoneInlayOptions = {\n    canvas: HTMLCanvasElement;\n    host: HTMLElement;\n    webgpu?: boolean;\n    maxPixelRatio?: number;\n    maskScale?: number;\n    look?: Partial<StoneLook>;\n    calm?: boolean;\n    onLost?(reason: string): void;\n};\nexport type StoneInlay = {\n    readonly mode: 'webgpu' | 'canvas2d';\n    look: StoneLook;\n    readonly lens: Readonly<Lens & {\n        open: number;\n    }>;\n    calm: boolean;\n    inlay(painter: InlayPainter | null): void;\n    invalidate(changed?: Box): void;\n    pointer(x: number, y: number): void;\n    setLens(lens: Partial<Lens>): void;\n    sweep(): void;\n    frame(dt: number): boolean;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare function createStoneInlay(options: StoneInlayOptions): Promise<StoneInlay>;"
        }
      ],
      "pitfalls": [
        "Give `[data-stone]` elements a transparent background",
        "Coordinates are CSS px from the host’s top left",
        "The mask holds a shape’s index a byte, with two check bytes beside it, so 255 shapes at most",
        "`invalidate(box)` bakes only that box (plus bevels and the lifted shadow)",
        "The bake is light-independent",
        "Under the loupe the stone is drawn live, so a big lens at a high zoom costs the most",
        "Keep the clone in line: the loupe clones the page once (`refresh()`)",
        "Never more than one frame on the GPU",
        "The pipelines compile in the background before the first frame",
        "A device lost later (a driver reset, a laptop waking) stops the slab",
        "The loupe places its clone where `content` sits in the host, at its size and scroll",
        "Text over stone is not checked for contrast by the stone"
      ],
      "card": "entries/stone-inlay.json"
    },
    {
      "id": "strand-creatures",
      "aliases": [],
      "name": "Strand creatures",
      "summary": "Creatures made of living lines: a few hundred strands, each a chain of points simulated on the GPU, pulled into a form by a handful of guides (one a limb, posed on the CPU each frame by a rig that plants the feet as it walks). Two compute passes a frame and nothing read back: Verlet with the pull into the form (each strand winds round its limb’s bundle, twisting along it, its tip fraying past the end), a squirm, gravity’s sag, a hit’s push and the ground; then follow-the-leader lengths and a frame carried along each strand. Each strand draws as a tube the vertex shader sweeps through its points. Eighteen forms (crawler, spider, centipede, serpent, hydra, a jelly, a web…) and twenty-two lines that dress the strands, from flesh with pumping veins, bone, chitin, bark and thorn vine to steel and cable, nanobot beads, ribbon, yarn and glowworms. Between forms of the same limbs the guides ease; otherwise the strands are dealt out again and flow into the new shape. A herd is copies in the same buffers (one dispatch a pass for all), the far ones a lighter tube. Compute on WebGPU; on three’s WebGL2 backend the same passes run as full-screen draws into float targets.",
      "category": "particles",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "expressive",
      "tags": [
        "verlet",
        "compute",
        "tubes",
        "parallel transport",
        "catmull-rom",
        "herds",
        "procedural animation",
        "tsl"
      ],
      "useCases": [
        "monsters and horror creatures",
        "tentacles and vines",
        "living cables",
        "organic route networks",
        "herds of creatures"
      ],
      "interaction": "Click near the creature to strike it · drag to orbit",
      "kits": [],
      "pairsWith": [
        {
          "id": "ring-effects",
          "why": "Marks and streaks where they are hit"
        },
        {
          "id": "word-swarm",
          "why": "Another living swarm"
        },
        {
          "id": "game-cameras",
          "why": "Follow a creature"
        }
      ],
      "variants": [],
      "version": "1.2.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-17",
          "gpuMs": 1.122,
          "cpuMs": 0.245,
          "cpuP95Ms": 0.355,
          "badge": "moderate",
          "drawCalls": 6,
          "computeDispatches": 2,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.145,
            "p99Ms": 6.11,
            "low1Fps": 152.1
          },
          "notes": null
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 8.651,
          "cpuMs": 0.727,
          "cpuP95Ms": 1.095,
          "badge": "heavy",
          "drawCalls": 4,
          "computeDispatches": 2,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 196 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 3.612,
          "cpuMs": 0.08,
          "cpuP95Ms": 0.12,
          "badge": "heavy",
          "drawCalls": 4,
          "computeDispatches": 2,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 736 ms."
        }
      ],
      "signatures": [
        {
          "file": "creatures/strands.ts",
          "declarations": "import { type CoreName, type TipName } from './kit';\nexport type Vec3 = [\n    number,\n    number,\n    number\n];\nexport type GuideRole = 'torso' | 'head' | 'leg' | 'arm' | 'tail' | 'anchor';\nexport declare const GUIDE_ROLES: readonly GuideRole[];\nexport type Guide = {\n    role: GuideRole;\n    points: [\n        Vec3,\n        Vec3,\n        Vec3,\n        Vec3\n    ];\n    radius: [\n        number,\n        number\n    ];\n    share: number;\n};\nexport declare const MAX_GUIDES = 16;\nexport type Form = {\n    guides: Guide[];\n    wave?: number;\n    fixed?: boolean;\n    stride?: number;\n};\nexport type StrandSpec = {\n    strands: number;\n    points: number;\n    thickness: number;\n    taper: number;\n    twist: number;\n    fray: number;\n    writhe: number;\n    writheSpeed: number;\n    stiffness: number;\n    slack: number;\n    pump: number;\n    brightness: number;\n    glow: number;\n    tint: string;\n    glowColour: string;\n    core: CoreName;\n    tips?: Partial<Record<GuideRole, TipName>>;\n    coreSize: number;\n    tipSize: number;\n    line: StrandLine;\n    lines?: Partial<Record<GuideRole, StrandLine>>;\n};\ntype Knob = {\n    label: string;\n    min: number;\n    max: number;\n    step: number;\n    recommended: number;\n    unit?: string;\n    hint: string;\n    rebuild?: boolean;\n};\nexport declare const STRAND_KNOBS: Record<Exclude<keyof StrandSpec, 'line' | 'lines' | 'tint' | 'glowColour' | 'core' | 'tips'>, Knob>;\nexport declare const DEFAULT_SPEC: StrandSpec;\nexport declare function strandSpec(raw: Partial<StrandSpec> | undefined): StrandSpec;\nexport type LineSection = 'round' | 'ribbon' | 'square' | 'beads';\nexport type LineTip = 'whip' | 'claw' | 'blunt' | 'bulb';\nexport type LineKind = {\n    label: string;\n    group: 'Organic' | 'Plant' | 'Machine' | 'Strange' | 'Horror' | 'Cozy';\n    hint: string;\n    section: LineSection;\n    tip: LineTip;\n    segment: number;\n    thorns: boolean;\n    rigid: number;\n    girth?: number;\n};\ndeclare const LINE_TABLE: {\n    flesh: {\n        label: string;\n        group: \"Organic\";\n        section: \"round\";\n        tip: \"whip\";\n        segment: number;\n        thorns: false;\n        rigid: number;\n        hint: string;\n    };\n    tentacle: {\n        label: string;\n        group: \"Organic\";\n        section: \"round\";\n        tip: \"whip\";\n        segment: number;\n        thorns: false;\n        rigid: number;\n        hint: string;\n    };\n    nerve: {\n        label: string;\n        group: \"Organic\";\n        section: \"round\";\n        tip: \"whip\";\n        segment: number;\n        thorns: false;\n        rigid: number;\n        hint: string;\n    };\n    necrotic: {\n        label: string;\n        group: \"Organic\";\n        section: \"round\";\n        tip: \"whip\";\n        segment: number;\n        thorns: false;\n        rigid: number;\n        hint: string;\n    };\n    irradiated: {\n        label: string;\n        group: \"Organic\";\n        section: \"round\";\n        tip: \"whip\";\n        segment: number;\n        thorns: false;\n        rigid: number;\n        hint: string;\n    };\n    bone: {\n        label: string;\n        group: \"Organic\";\n        section: \"round\";\n        tip: \"claw\";\n        segment: number;\n        thorns: false;\n        rigid: number;\n        hint: string;\n    };\n    bark: {\n        label: string;\n        group: \"Plant\";\n        section: \"round\";\n        tip: \"blunt\";\n        segment: number;\n        thorns: false;\n        rigid: number;\n        hint: string;\n    };\n    vine: {\n        label: string;\n        group: \"Plant\";\n        section: \"round\";\n        tip: \"whip\";\n        segment: number;\n        thorns: true;\n        rigid: number;\n        hint: string;\n    };\n    mech: {\n        label: string;\n        group: \"Machine\";\n        section: \"square\";\n        tip: \"claw\";\n        segment: number;\n        thorns: false;\n        rigid: number;\n        hint: string;\n    };\n    cable: {\n        label: string;\n        group: \"Machine\";\n        section: \"round\";\n        tip: \"blunt\";\n        segment: number;\n        thorns: false;\n        rigid: number;\n        hint: string;\n    };\n    nanobot: {\n        label: string;\n        group: \"Machine\";\n        section: \"beads\";\n        tip: \"whip\";\n        segment: number;\n        thorns: false;\n        rigid: number;\n        hint: string;\n    };\n    ink: {\n        label: string;\n        group: \"Strange\";\n        section: \"round\";\n        tip: \"whip\";\n        segment: number;\n        thorns: false;\n        rigid: number;\n        hint: string;\n    };\n    ribbon: {\n        label: string;\n        group: \"Strange\";\n        section: \"ribbon\";\n        tip: \"blunt\";\n        segment: number;\n        thorns: false;\n        rigid: number;\n        hint: string;\n    };\n    sinew: {\n        label: string;\n        group: \"Horror\";\n        section: \"round\";\n        tip: \"whip\";\n        segment: number;\n        thorns: false;\n        rigid: number;\n        hint: string;\n    };\n    hair: {\n        label: string;\n        group: \"Horror\";\n        section: \"round\";\n        tip: \"whip\";\n        segment: number;\n        thorns: false;\n        rigid: number;\n        girth: number;\n        hint: string;\n    };\n    maggot: {\n        label: string;\n        group: \"Horror\";\n        section: \"round\";\n        tip: \"blunt\";\n        segment: number;\n        thorns: false;\n        rigid: number;\n        girth: number;\n        hint: string;\n    };\n    chitin: {\n        label: string;\n        group: \"Horror\";\n        section: \"round\";\n        tip: \"claw\";\n        segment: number;\n        thorns: false;\n        rigid: number;\n        hint: string;\n    };\n    fluff: {\n        label: string;\n        group: \"Cozy\";\n        section: \"round\";\n        tip: \"blunt\";\n        segment: number;\n        thorns: false;\n        rigid: number;\n        girth: number;\n        hint: string;\n    };\n    petal: {\n        label: string;\n        group: \"Cozy\";\n        section: \"ribbon\";\n        tip: \"blunt\";\n        segment: number;\n        thorns: false;\n        rigid: number;\n        hint: string;\n    };\n    yarn: {\n        label: string;\n        group: \"Cozy\";\n        section: \"round\";\n        tip: \"blunt\";\n        segment: number;\n        thorns: false;\n        rigid: number;\n        girth: number;\n        hint: string;\n    };\n    candy: {\n        label: string;\n        group: \"Cozy\";\n        section: \"round\";\n        tip: \"blunt\";\n        segment: number;\n        thorns: false;\n        rigid: number;\n        hint: string;\n    };\n    glowworm: {\n        label: string;\n        group: \"Cozy\";\n        section: \"round\";\n        tip: \"whip\";\n        segment: number;\n        thorns: false;\n        rigid: number;\n        hint: string;\n    };\n};\nexport type StrandLine = keyof typeof LINE_TABLE;\nexport declare const LINES: Record<StrandLine, LineKind>;\nexport declare const LINE_NAMES: StrandLine[];\nexport declare const lineFor: (spec: Pick<StrandSpec, \"line\" | \"lines\">, role: GuideRole) => StrandLine;\ndeclare const FORM_TABLE: {\n    crawler: {\n        guides: Guide[];\n    };\n    rearing: {\n        guides: Guide[];\n    };\n    knot: {\n        guides: Guide[];\n    };\n    hydra: {\n        guides: Guide[];\n    };\n    centipede: {\n        guides: Guide[];\n        stride: number;\n        wave: number;\n    };\n    husk: {\n        guides: Guide[];\n        stride: number;\n    };\n    maw: {\n        guides: Guide[];\n        fixed: true;\n    };\n    hanger: {\n        guides: Guide[];\n        fixed: true;\n    };\n    serpent: {\n        guides: Guide[];\n        wave: number;\n    };\n    web: {\n        guides: Guide[];\n        fixed: true;\n    };\n    spider: {\n        guides: Guide[];\n        stride: number;\n    };\n    stalker: {\n        guides: Guide[];\n        stride: number;\n    };\n    wurm: {\n        guides: Guide[];\n        fixed: true;\n    };\n    tick: {\n        guides: Guide[];\n        stride: number;\n    };\n    puff: {\n        guides: Guide[];\n        stride: number;\n    };\n    bunny: {\n        guides: Guide[];\n        stride: number;\n    };\n    jelly: {\n        guides: Guide[];\n        fixed: true;\n    };\n    sprout: {\n        guides: Guide[];\n        stride: number;\n    };\n};\nexport type FormName = keyof typeof FORM_TABLE;\nexport declare const FORMS: Record<FormName, Form>;\nexport declare const FORM_NAMES: FormName[];\nexport declare function guidePoint(points: readonly Vec3[], u: number): Vec3;\nexport declare const legLength: (guide: Guide) => number;\nexport declare function guideLength(points: readonly Vec3[]): number;\nexport type StrandLayout = {\n    guide: number;\n    angle: number;\n    radial: number;\n    u0: number;\n    u1: number;\n    girth: number;\n    seed: number;\n};\nexport declare function layoutStrands(count: number, guides: readonly Guide[], fray: number, seed?: number): StrandLayout[];\nexport declare function sameShape(a: Form, b: Form): boolean;\nexport declare function blendForms(a: Form, b: Form, t: number): Form;\nexport type Body = {\n    x: number;\n    y: number;\n    z: number;\n    heading: number;\n};\nexport type Stance = {\n    y: number;\n    pitch: number;\n    roll: number;\n};\nexport declare const LEAN: {\n    readonly most: 0.61;\n    readonly ease: 8;\n};\nexport declare function footprint(form: Form): {\n    length: number;\n    width: number;\n    stand: [\n        number,\n        number\n    ];\n    lean: [\n        number,\n        number\n    ];\n};\nexport declare const GROUND_GRID = 5;\nexport type GroundGrid = {\n    x0: number;\n    z0: number;\n    cell: number;\n    heights: Float32Array;\n};\nexport declare function groundReach(form: Form): number;\nexport declare function groundGrid(ground: (x: number, z: number) => number, x: number, z: number, reach: number, into?: GroundGrid): GroundGrid;\nexport declare function groundAt(grid: GroundGrid, x: number, z: number): number;\nexport declare const GAIT: {\n    readonly reach: 0.55;\n    readonly step: 0.32;\n    readonly lift: 0.35;\n    readonly quickest: 0.08;\n    readonly behind: 2.5;\n};\nexport declare const tripodOf: (leg: number) => 0 | 1;\nexport declare class GuideRig {\n    lastPose: Guide[];\n    stance: Stance | null;\n    pose(form: Form, body: Body, dt: number, ground?: (x: number, z: number) => number): Guide[];\n    get holds(): Vec3[];\n    reset(): void;\n}\nexport type CreatureData = {\n    spec: StrandSpec;\n    form: Form;\n    from?: FormName;\n};\nexport declare function creatureIssues(data: unknown): string[];\nexport declare function readCreature(data: unknown): CreatureData;\nexport declare function mirrorOf(form: Form, g: number): number;\nexport declare function movePoint(form: Form, g: number, j: number, to: Vec3, mirror: boolean): Form;\nexport declare function changeGuide(form: Form, g: number, patch: Partial<Pick<Guide, 'role' | 'radius' | 'share'>>, mirror: boolean): Form;\nexport declare function duplicateGuide(form: Form, g: number): Form;\nexport declare function removeGuide(form: Form, g: number): Form;\nexport {};"
        },
        {
          "file": "strand-creature.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { type GroundGrid, type Guide, type StrandLine, type StrandSpec } from './creatures/strands';\nimport { type TipName } from './creatures/kit';\nimport { type CoilingGuide } from './creatures/coil';\nexport type StrandCreatureOptions = {\n    textures?: boolean;\n};\nexport declare class StrandCreature {\n    readonly group: THREE.Group<THREE.Object3DEventMap>;\n    spec: StrandSpec;\n    readonly copies: number;\n    readonly storage: 'buffers' | 'textures';\n    static needsTextures(renderer: THREE.WebGPURenderer): boolean;\n    static canRenderFloat(renderer: THREE.WebGPURenderer): boolean;\n    constructor(spec: StrandSpec, form: readonly Guide[], copies?: number, { textures }?: StrandCreatureOptions);\n    reform(guides: readonly Guide[]): void;\n    show(near?: readonly number[], far?: readonly number[]): void;\n    setTipShapes(shapes: Map<TipName, THREE.BufferGeometry>): void;\n    setLines(spec: StrandSpec): void;\n    warmLines(renderer: THREE.WebGPURenderer, camera: THREE.Camera, scene: THREE.Scene, lines: readonly StrandLine[]): Promise<void>;\n    setTips(spec: StrandSpec): void;\n    setKnobs(spec: StrandSpec): void;\n    setGuides(guides: readonly CoilingGuide[], copy?: number): void;\n    setLife(copy: number, life: number): void;\n    setGround(copy: number, grid: GroundGrid): void;\n    strike(at: THREE.Vector3Like, strength?: number): void;\n    snap(): void;\n    update(renderer: THREE.WebGPURenderer, dt: number, groundY?: number): void;\n    dispose(): void;\n}"
        }
      ],
      "pitfalls": [
        "Guides come from the CPU each frame (a few hundred bytes)",
        "Changing the strand or point count rebuilds the buffers and compiles new pipelines",
        "A herd is one creature with copies",
        "Between forms with the same limbs, blend the guides (blendForms)",
        "Each line is a material built the first time it draws",
        "Ground under each copy is a small height grid (setGround)",
        "Without WebGPU, pass `{ textures: StrandCreature.needsTextures(renderer) }`"
      ],
      "card": "entries/strand-creatures.json"
    },
    {
      "id": "streaming-spreadsheets",
      "aliases": [],
      "name": "Open huge CSV and Excel files without freezing",
      "summary": "Reads 64 MB+ CSV and .xlsx files in the browser a piece at a time: the zip’s directory first, entries inflated by the browser’s own DecompressionStream, rows scanned out of the XML as bytes, CSV separators guessed and numbers read in either format, with progress, cancelling and an optional worker. Writes CSV and .xlsx back. No dependencies.",
      "category": "systems",
      "role": "system",
      "stack": [
        "headless"
      ],
      "character": "calm",
      "tags": [
        "csv",
        "xlsx",
        "excel",
        "zip",
        "streaming",
        "DecompressionStream",
        "CompressionStream",
        "web worker",
        "file import",
        "export",
        "no dependencies"
      ],
      "useCases": [
        "importing customer spreadsheets",
        "data tools and dashboards",
        "previewing a file before upload",
        "exporting tables to Excel",
        "offline and privacy-first apps"
      ],
      "interaction": "Drop a CSV or .xlsx, choose one, or make a 50 MB sample · download it back as .xlsx or CSV",
      "kits": [
        {
          "kit": "dashboard",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "data-table",
          "why": "Show the rows as they stream in"
        },
        {
          "id": "sheet-chart-suggest",
          "why": "Charts that fit the columns read"
        },
        {
          "id": "file-drop",
          "why": "Drop the file to read"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.80",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-04",
          "gpuMs": null,
          "cpuMs": 2.627,
          "cpuP95Ms": 3.795,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured exercising itself: every frame feeds 64 kB of generated CSV (about 1,000 rows, semicolons and decimal commas) through the streaming parser, reads its numbers, updates the column profile and repaints the counts, all inside update. That is reading about 3.8 MB a second on the page’s own thread; off the bench, reading runs between frames or in a worker and only the repaint is per frame."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 2.525,
          "cpuP95Ms": 2.85,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 87 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 1.9,
          "cpuP95Ms": 3.06,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 101 ms."
        }
      ],
      "signatures": [
        {
          "file": "index.ts",
          "declarations": "export { openTable, sniffFormat, type OpenTableOpts, type TableFormat, type TableInfo, type TableProgress, type TableRead } from './open-table';\nexport { openTableInWorker, type WorkerTableOpts } from './open-in-worker';\nexport { openXlsx, readShared, streamSheet, excelDate, styleKinds, colIndex, type Cell, type RawRow, type XlsxBook, type XlsxSheet, type SheetRead, type Merge } from './xlsx-read';\nexport { CsvParser, streamCsv, sniffSeparator, parseGrid, parseTable, own, type CsvLine } from './csv';\nexport { readCell, hasHeader, isPlainNumber } from './cells';\nexport { listZip, streamEntry, entryText, blobSource, bytesSource, Cancelled, ZipError, type ByteSource, type ZipEntry, type StreamOpts } from './zip';\nexport { writeXlsx, colName, type SheetInput, type XlsxWriteOpts } from './xlsx-write';\nexport { toCsv, csvBlob } from './csv';\nexport { writeZip, crc32, type ZipInput, type ZipWriteOpts } from './zip-write';\nexport { pacer, yieldToPage } from './yield';"
        }
      ],
      "pitfalls": [
        "Values cut from one big string keep the whole string alive in V8",
        "Read numbers on purpose: “1,234” is a thousand and some in one locale and one and a bit in…",
        "An .xlsx reads its shared strings first and keeps them all",
        "A formula cell gives the value Excel last saved",
        "Awaiting a stream is not yielding",
        "Rows posted from a worker are copied (structured clone)",
        "The writer makes plain zips",
        "Excel opens UTF-8 CSV correctly only with a byte-order mark (`csvBlob(rows, { bom: true })`)"
      ],
      "card": "entries/streaming-spreadsheets.json"
    },
    {
      "id": "stroke-font-text",
      "aliases": [],
      "name": "Stroke fonts as motion paths",
      "summary": "Text as single-stroke glyph paths that can be drawn, traced and animated: three hand-made stroke fonts, one layout (kerning, line breaks), a path sampler, and three looks built on it in Canvas 2D: a neon sign that buzzes on, a light trail that writes, light cycles whose walls spell the words.",
      "category": "ui",
      "role": "hero-visual",
      "stack": [
        "canvas2d"
      ],
      "character": "balanced",
      "tags": [
        "text",
        "stroke font",
        "single-line font",
        "canvas 2d",
        "glow",
        "neon",
        "path animation",
        "kerning",
        "no dependencies"
      ],
      "useCases": [
        "title cards and level-up moments",
        "splash screens and empty states",
        "signage in games and scenes",
        "text for plotters, lasers and engraving",
        "handwriting and drawing-on effects",
        "path-following animation"
      ],
      "interaction": "Type your own words · pick a look · Enter or a click on the stage plays them",
      "kits": [],
      "pairsWith": [
        {
          "id": "ink-strokes",
          "why": "Handwriting beside the stroke fonts"
        },
        {
          "id": "read-reveals",
          "why": "Passages revealed as they are read"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "canvas2d",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "Halos of what stands still blurred once and redrawn: the same picture. What moves blurs as at high.",
          "low": "As medium, the cached halos at half the resolution; what moves builds its wide bloom from faint strokes instead of a blur."
        },
        "reducedMotion": false
      },
      "toneKnobs": [
        {
          "name": "motion",
          "in": "module",
          "values": {
            "strict": false
          }
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.80",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-03",
          "gpuMs": null,
          "cpuMs": 0.265,
          "cpuP95Ms": 0.605,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured looping: each pass plays one look start to finish and the next pass the next look (neon striking and humming, the trail writing, the cycles riding), so the frames include all three. The cost is the canvas strokes and their shadow blur, drawn every frame."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.31,
          "cpuP95Ms": 1.03,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 80 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.08,
          "cpuP95Ms": 0.36,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 58 ms."
        }
      ],
      "signatures": [
        {
          "file": "arcade-font.ts",
          "declarations": "import type { StrokeFont } from './font';\nexport declare const ARCADE: StrokeFont;"
        },
        {
          "file": "cycle-font.ts",
          "declarations": "import type { StrokeFont } from './font';\nexport declare const CYCLE: StrokeFont;"
        },
        {
          "file": "layout.ts",
          "declarations": "import { type Point, type StrokeFont } from './font';\nimport { Polyline } from './path';\nexport type PlacedGlyph = {\n    ch: string;\n    index: number;\n    line: number;\n    x: number;\n    y: number;\n    width: number;\n    strokes: Point[][];\n    paths: Polyline[];\n};\nexport type TextLine = {\n    x: number;\n    y: number;\n    width: number;\n    text: string;\n    glyphs: PlacedGlyph[];\n};\nexport type TextLayout = {\n    font: StrokeFont;\n    size: number;\n    scale: number;\n    width: number;\n    height: number;\n    lines: TextLine[];\n    glyphs: PlacedGlyph[];\n    inkLength: number;\n};\nexport type LayoutOptions = {\n    size: number;\n    maxWidth?: number;\n    lineHeight?: number;\n    align?: 'left' | 'centre' | 'right';\n    kerning?: number;\n    tracking?: number;\n};\nexport declare function kernPair(font: StrokeFont, a: string, b: string, k: number): number;\nexport declare function measureText(font: StrokeFont, text: string, size: number, options?: Pick<LayoutOptions, 'kerning' | 'tracking'>): number;\nexport declare function layoutText(font: StrokeFont, text: string, options: LayoutOptions): TextLayout;"
        },
        {
          "file": "light-cycles.ts",
          "declarations": "import type { Point } from './font';\nimport { type QualityTier } from './glow';\nimport type { TextLayout } from './layout';\nexport type CycleOptions = {\n    colour: string;\n    accent: string;\n    glow: number;\n    motion: boolean;\n    pitch: number;\n    stretch: number;\n    wall: number;\n    floor: boolean;\n    rivals: boolean;\n    delay: number;\n    tier: QualityTier;\n};\nexport declare function lightCycles(layout: TextLayout, options?: Partial<CycleOptions>): {\n    options: CycleOptions;\n    layout: TextLayout;\n    rebuild: () => void;\n    project: (x: number, y: number, h?: number) => Point;\n    readonly duration: number;\n    readonly bounds: {\n        x: number;\n        y: number;\n        width: number;\n        height: number;\n    };\n    draw(ctx: CanvasRenderingContext2D, t: number): void;\n};\nexport type LightCycles = ReturnType<typeof lightCycles>;"
        },
        {
          "file": "light-trail.ts",
          "declarations": "import { type QualityTier } from './glow';\nimport type { TextLayout } from './layout';\nexport type TrailOptions = {\n    colour: string;\n    colour2: string;\n    glow: number;\n    motion: boolean;\n    duration: number;\n    spread: number;\n    beam: number;\n    sparkEvery: number;\n    tier: QualityTier;\n};\nexport declare function lightTrail(layout: TextLayout, options?: Partial<TrailOptions>): {\n    options: TrailOptions;\n    layout: TextLayout;\n    readonly duration: number;\n    bounds: {\n        x: number;\n        y: number;\n        width: number;\n        height: number;\n    };\n    draw(ctx: CanvasRenderingContext2D, t: number): void;\n};\nexport type LightTrail = ReturnType<typeof lightTrail>;"
        },
        {
          "file": "neon-font.ts",
          "declarations": "import type { StrokeFont } from './font';\nexport declare const NEON: StrokeFont;"
        },
        {
          "file": "neon-sign.ts",
          "declarations": "import { type QualityTier } from './glow';\nimport type { TextLayout } from './layout';\nexport type NeonOptions = {\n    colour: string;\n    frameColour: string;\n    glow: number;\n    motion: boolean;\n    frame: boolean;\n    reflection: number;\n    delay: number;\n    stagger: number;\n    tube: number;\n    random: () => number;\n    tier: QualityTier;\n};\nexport declare function neonSign(layout: TextLayout, options?: Partial<NeonOptions>): {\n    options: NeonOptions;\n    layout: TextLayout;\n    readonly duration: number;\n    floorY: number;\n    readonly bounds: {\n        x: number;\n        y: number;\n        width: number;\n        height: number;\n    };\n    draw(ctx: CanvasRenderingContext2D, t: number): void;\n};\nexport type NeonSign = ReturnType<typeof neonSign>;"
        }
      ],
      "pitfalls": [
        "Canvas shadow blur ignores the transform",
        "Stroke a whole letter (or all letters equally lit) in one path",
        "Do not fake a blur-only halo by drawing the path far off the canvas and offsetting its shadow…",
        "Shadow blur is the cost: a few dozen blurred strokes a frame are fine, hundreds are not",
        "Safari composites every shadowBlur on the GPU each frame, outside the script time",
        "Draw onto a transparent canvas over a CSS backdrop",
        "The fonts are upper case only",
        "A perspective floor needs a near limit",
        "Reduced motion should show the finished words at once"
      ],
      "card": "entries/stroke-font-text.json"
    },
    {
      "id": "sun-shadow",
      "aliases": [],
      "name": "Sun shadow",
      "summary": "One sun’s shadow that stays crisp and still: the shadow map is refitted every frame to the ground the camera sees (at three heights, for relief and tall buildings, up to a distance you set), its size in fixed steps and its centre snapped to whole texels in the light’s plane, so an edge fixed in the world never shimmers as the camera moves; edges are filtered by a fixed 3×3 tent in texel space (three r185’s PCFSoft, which r186 removed from the WebGPU renderer, where asking for it falls back to three’s PCF and its taps rotated by screen noise: dithered edges that crawl as the view pans). The depth bias holds about 4 cm whatever the box’s depth, the normal bias grows as the sun drops (no acne stripes at dawn), and a receiver fix measures it along the geometric normal (no dark strip moving along wall bases under normal maps). From a game that tuned it at length; a fixed box over a whole scene spends the map on empty country and turns edges to stairs.",
      "category": "technique",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "calm",
      "tags": [
        "shadows",
        "shadow map",
        "directional light",
        "sun",
        "pcf",
        "soft shadows",
        "texel snapping",
        "shimmer",
        "shadow acne",
        "normal bias",
        "tsl",
        "three.js",
        "webgpu",
        "webgl"
      ],
      "useCases": [
        "any outdoor scene with a sun: towns, terrain, games, product shots outside",
        "shadow edges that look dithered or crawl when the camera pans (three r186 and later on WebGPU)",
        "staircase shadow edges under eaves and fences in a large scene",
        "acne stripes at a low sun, and a dark strip along wall bases with normal maps"
      ],
      "interaction": "Drag to turn round the block · switch the edge filter and the shadow box to compare · lower the sun",
      "kits": [],
      "pairsWith": [
        {
          "id": "low-poly-props",
          "why": "Its harbour village uses this sun"
        },
        {
          "id": "shape-kit",
          "why": "Scenes made in code, under a sun that does them justice"
        },
        {
          "id": "cloud-shadows",
          "why": "Drifting shade on top of the sun’s shadow"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 0.223,
          "cpuMs": 0.33,
          "cpuP95Ms": 0.82,
          "badge": "light",
          "drawCalls": 12,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.663,
            "p99Ms": 6.475,
            "low1Fps": 147.9
          },
          "notes": "A block of 76 small houses with overhanging roofs and fences, three towers, one 2,048-px sun shadow fitted to the view each frame and filtered by the tent, the camera turning slowly round the block."
        }
      ],
      "signatures": [
        {
          "file": "sun-shadow.ts",
          "declarations": "import { Vector3, type Camera, type DirectionalLight } from 'three/webgpu';\nexport type SunShadowOptions = {\n    mapSize?: number;\n    minSize?: number;\n    step?: number;\n    guard?: number;\n    heights?: [\n        number,\n        number,\n        number\n    ];\n    reach?: number;\n    distance?: number;\n    normalBias?: number;\n    soft?: boolean;\n};\nexport type SunShadow = {\n    setDirection(toLight: {\n        x: number;\n        y: number;\n        z: number;\n    }): void;\n    fit(camera: Camera, groundY?: number, distance?: number): void;\n    readonly texel: number;\n    receiverPosition(): unknown;\n};\nexport declare function groundPolygon(camera: Camera, y: number, out?: Vector3[]): Vector3[];\nexport declare function useSoftShadows(renderer: {\n    shadowMap: {\n        type: number;\n    };\n}, ...shadows: DirectionalLight['shadow'][]): void;\nexport declare function sunShadowNormalBias(toLightY: number, high?: number): number;\nexport declare function createSunShadow(renderer: {\n    shadowMap: {\n        enabled: boolean;\n        type: number;\n    };\n}, sun: DirectionalLight, o?: SunShadowOptions): SunShadow;"
        }
      ],
      "pitfalls": [
        "Call fit(camera) every frame before rendering, after the camera moved",
        "PCFSoftShadowMap does nothing on three r186+ with WebGPU",
        "The further the box reaches (distance), the coarser each texel",
        "The box covers the ground at three heights",
        "Three picks a light’s shadow filter once, when it first draws the shadow, and never looks again",
        "The receiver fix is a node",
        "One cascade: very large views (a flight over 5 km) want cascaded shadows instead"
      ],
      "card": "entries/sun-shadow.json"
    },
    {
      "id": "swipe-actions",
      "aliases": [],
      "name": "Swipe a row for actions",
      "summary": "Swipe a list row, as on a phone: a short swipe shows its buttons, a long one runs the outer action (delete), a quick flick opens and a flick back closes. Vertical drags still scroll, one row is open at a time, and the drag’s own click is swallowed. Actions on either side, the buttons spreading in proportion and the main one taking over as the swipe arms; arrow keys, the Menu key and a More button for the keyboard and screen readers; an undo toast; right to left; plain DOM.",
      "category": "ui",
      "role": "interaction",
      "stack": [
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "swipe",
        "gesture",
        "list",
        "row actions",
        "delete",
        "archive",
        "undo",
        "toast",
        "touch",
        "mouse",
        "keyboard",
        "spring",
        "live region",
        "accessibility",
        "rtl",
        "reduced motion",
        "dom",
        "css",
        "no dependencies"
      ],
      "useCases": [
        "delete, archive and pin in an inbox or a to-do list",
        "mail, chat and notification lists on phones",
        "shopping and packing lists",
        "settings rows with a remove button",
        "any list where an undo beats a confirm dialog"
      ],
      "interaction": "Swipe or drag a message left or right · swipe far to delete · focus one and press ← or Menu · Delete, E and P work too",
      "kits": [
        {
          "kit": "shop",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "drag-reorder",
          "why": "Reorder the same list"
        },
        {
          "id": "labelled-undo",
          "why": "Undo a swiped delete by name"
        },
        {
          "id": "list-smarts",
          "why": "Lists that learn the customer"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 0.2,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the demo swiping by itself: synthetic pointer events open a row (24 frames), it rests, closes, then a long swipe deletes the next row (30 frames), it slides out and closes up, the undo toast shows and Undo puts it back. Each moving frame writes three custom properties on one row and its spring; nothing runs between gestures."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 0.15,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 41 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.1,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 118 ms."
        }
      ],
      "signatures": [
        {
          "file": "swipe-actions.ts",
          "declarations": "import { type Messages, type Side, type Tuning } from './swipe-model';\nexport type { Side } from './swipe-model';\nexport type SwipeAction = {\n    id: string;\n    label: string;\n    icon?: string;\n    tone?: 'danger' | 'accent' | 'warn' | 'ok' | 'neutral';\n    removes?: boolean;\n    keys?: string[];\n    done?: string;\n};\nexport type SwipeSides = {\n    start?: SwipeAction[];\n    end?: SwipeAction[];\n};\nexport type SwipeActionEvent = {\n    row: HTMLElement;\n    action: SwipeAction;\n    side: Side;\n    via: 'swipe' | 'tap' | 'keyboard';\n};\nexport type SwipeOptions = {\n    items?: string;\n    content?: string;\n    actions: SwipeSides | ((row: HTMLElement) => SwipeSides);\n    onAction?: (e: SwipeActionEvent) => void;\n    full?: boolean | Partial<Record<Side, boolean>>;\n    tuning?: Partial<Tuning>;\n    more?: boolean;\n    arrows?: boolean;\n    label?: (row: HTMLElement) => string;\n    messages?: Partial<Messages>;\n    reducedMotion?: boolean;\n    haptics?: boolean;\n    ignore?: string;\n    onSay?: (text: string) => void;\n};\nexport type SwipeList = {\n    readonly element: HTMLElement;\n    readonly openRow: HTMLElement | null;\n    options: SwipeOptions;\n    open(row: HTMLElement, side?: Side, focus?: boolean): void;\n    close(row?: HTMLElement): void;\n    run(row: HTMLElement, id: string): void;\n    enter(row: HTMLElement): Promise<void>;\n    refresh(): void;\n    destroy(): void;\n};\nexport declare function swipeActions(list: HTMLElement, options: SwipeOptions): SwipeList;"
        },
        {
          "file": "undo-toast.ts",
          "declarations": "export type UndoNote = {\n    onUndo: (info: {\n        hadFocus: boolean;\n    }) => void;\n    onExpire?: () => void;\n    undone?: string;\n    ms?: number;\n};\nexport type UndoToastOptions = {\n    host?: HTMLElement;\n    ms?: number;\n    undoLabel?: string;\n    keys?: boolean;\n    reducedMotion?: boolean;\n    onSay?: (text: string) => void;\n};\nexport type UndoToast = {\n    show(message: string, note: UndoNote): void;\n    dismiss(): void;\n    readonly showing: boolean;\n    destroy(): void;\n};\nexport declare function undoToast(options?: UndoToastOptions): UndoToast;"
        }
      ],
      "pitfalls": [
        "Import swipe-actions.base.css, then swipe-actions.css (or your own look)",
        "The row clips (overflow: clip), so a focus ring drawn outside the content is cut off",
        "The content slides with the translate property",
        "A removing action calls onAction only after the row has slid out and closed up",
        "Presses on a row never select its text or drag its links and images",
        "Keys are read on the row, so a row whose content takes the arrow keys itself",
        "Any scroll on the page closes the open row, as phones do",
        "If a framework re-renders a row, the module notices",
        "Screen-reader gestures replace swiping"
      ],
      "card": "entries/swipe-actions.json"
    },
    {
      "id": "tabs-tooltips",
      "aliases": [],
      "name": "Tabs, segmented controls and tooltips, done properly",
      "summary": "Three small cores that get the details right. Tabs with one Tab stop, arrows that wrap and turn round in right to left, Home and End, automatic or manual activation, a vertical option and a row that scrolls with buttons when it overflows. A segmented control built on real radio inputs, with a pill that slides only when the choice changes. Tooltips that wait for a hover but show at once on keyboard focus, stay while you move onto them, hide on Esc, flip and slide to stay on screen, and need a long press on touch. Restyle them through their parts.",
      "category": "ui",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "tabs",
        "tablist",
        "segmented control",
        "radio group",
        "tooltip",
        "roving tabindex",
        "aria-describedby",
        "placement",
        "accessibility",
        "keyboard",
        "touch",
        "rtl",
        "dom",
        "css",
        "no dependencies"
      ],
      "useCases": [
        "settings and detail pages split into sections",
        "view switchers (list, board, calendar)",
        "ranges and filters with two to five choices",
        "icon-only toolbars that need names",
        "hints beside form fields"
      ],
      "interaction": "Tab into each control and use the arrows · hover or focus the toolbar for tips · Esc hides a tip",
      "kits": [
        {
          "kit": "foundations",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "menu-skins",
          "why": "Menus with the same keyboard rules"
        },
        {
          "id": "keyboard-shortcuts",
          "why": "Shortcuts shown in tooltips"
        },
        {
          "id": "appearance-theme",
          "why": "Themes the tabs follow"
        }
      ],
      "variants": [],
      "version": "1.0.2",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.235,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the demo driving itself, one step every 20 frames: the next tab is chosen (its panel shown, the marker slid), the view and range segments move on, and a toolbar tooltip is shown and placed, then hidden. Nothing runs between steps: every core rests until something happens."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 0.32,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 98 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.02,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 72 ms."
        }
      ],
      "signatures": [
        {
          "file": "segmented.ts",
          "declarations": "export type SegmentOption = {\n    value: string;\n    label: string;\n    icon?: string;\n    disabled?: boolean;\n};\nexport type SegmentedOptions = {\n    options: SegmentOption[];\n    value?: string;\n    label?: string;\n    labelledBy?: string;\n    name?: string;\n    equal?: boolean;\n    reducedMotion?: boolean;\n    onChange?: (value: string) => void;\n};\nexport type Segmented = {\n    readonly element: HTMLElement;\n    value: string;\n    disable(value: string, disabled: boolean): void;\n    destroy(): void;\n};\nexport declare function createSegmented(host: HTMLElement, options: SegmentedOptions): Segmented;"
        },
        {
          "file": "tabs.ts",
          "declarations": "import { type Orientation } from './model';\nexport type TabsOptions = {\n    panels?: HTMLElement[];\n    selected?: number | string;\n    activation?: 'auto' | 'manual';\n    orientation?: Orientation;\n    wrap?: boolean;\n    label?: string;\n    overflow?: boolean;\n    scrollLabels?: {\n        back: string;\n        forward: string;\n    };\n    ink?: boolean;\n    reducedMotion?: boolean;\n    onChange?: (index: number, tab: HTMLElement, panel: HTMLElement | undefined) => void;\n};\nexport type Tabs = {\n    readonly list: HTMLElement;\n    readonly tabs: HTMLElement[];\n    readonly panels: HTMLElement[];\n    readonly selected: number;\n    select(which: number | string, opts?: {\n        focus?: boolean;\n    }): void;\n    refresh(): void;\n    destroy(): void;\n};\nexport declare function createTabs(list: HTMLElement, options?: TabsOptions): Tabs;"
        },
        {
          "file": "tooltip.ts",
          "declarations": "import { type Box, type Side } from './model';\nexport type TooltipOptions = {\n    text?: string;\n    keys?: string;\n    side?: Side | 'start' | 'end';\n    delay?: number;\n    skipDelay?: number;\n    hideDelay?: number;\n    as?: 'description' | 'label';\n    host?: HTMLElement;\n    bounds?: () => Box;\n    longPress?: number | false;\n    gap?: number;\n    className?: string;\n    animate?: (tip: HTMLElement, phase: 'open' | 'close') => Promise<unknown> | void;\n    reducedMotion?: boolean;\n    onShow?: (info: {\n        by: ShowReason;\n        side: Side;\n        flipped: boolean;\n    }) => void;\n    onHide?: (why: HideReason) => void;\n};\nexport type ShowReason = 'hover' | 'focus' | 'touch' | 'code';\nexport type HideReason = 'leave' | 'blur' | 'escape' | 'press' | 'another' | 'scrolled-away' | 'code';\nexport type Tooltip = {\n    readonly anchor: HTMLElement;\n    readonly element: HTMLElement;\n    readonly open: boolean;\n    text: string;\n    show(by?: ShowReason): void;\n    hide(why?: HideReason): void;\n    update(): void;\n    destroy(): void;\n};\nexport declare function tooltip(anchor: HTMLElement, options?: TooltipOptions): Tooltip;\nexport type TooltipGroup = {\n    get(anchor: HTMLElement): Tooltip | undefined;\n    refresh(): void;\n    destroy(): void;\n};\nexport declare function tooltips(root: ParentNode, options?: TooltipOptions & {\n    selector?: string;\n}): TooltipGroup;"
        }
      ],
      "pitfalls": [
        "Import tabs-tooltips.base.css before tabs-tooltips.css (or your own look)",
        "A tooltip is a hint, never the only place something is said",
        "Disabled buttons fire no pointer events in some browsers, so their tips never show",
        "The tip lives in document.body by default",
        "An icon-only button gets its name from the tip with as",
        "Tabs with overflow wrap the tablist in a strip of their own (to hold the scroll buttons)",
        "Manual activation keeps the Tab stop on the chosen tab",
        "The markers follow the layout through a ResizeObserver"
      ],
      "card": "entries/tabs-tooltips.json"
    },
    {
      "id": "terrain-shaping",
      "aliases": [],
      "name": "Terrain shaping",
      "summary": "Pure height-function transforms for contour terraces, a carved valley, level pads and a coastline of cliffs and beaches. Retaining walls and cliff chains return abstract placements; wet benches return shallow pool cells. Compose the functions, then sample once onto your terrain lattice.",
      "category": "technique",
      "role": "system",
      "stack": [
        "headless"
      ],
      "character": "calm",
      "tags": [
        "terrain",
        "heightfield",
        "terraces",
        "valley",
        "pads",
        "coast",
        "cliffs",
        "beaches",
        "pure functions",
        "no dependencies"
      ],
      "useCases": [
        "cut and fill a hillside into level terraces",
        "carve a flat valley floor with eased sides",
        "level circular building footprints",
        "join a coastal heightfield to cliff walls and gentle beaches"
      ],
      "interaction": "Switch each shaping pass on or off · choose a close view · drag to orbit",
      "kits": [],
      "pairsWith": [
        {
          "id": "heightfield-chunks",
          "why": "Sample the composed height function onto a streamed world lattice"
        },
        {
          "id": "world-surfaces",
          "why": "Shade the resulting ground and use sandAt to blend a beach finish"
        },
        {
          "id": "sun-shadow",
          "why": "Light the heightfield and retaining walls"
        }
      ],
      "variants": [],
      "version": "1.0.5",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "Procedural colours without bump normals; 1024 sun shadow",
          "low": "Baked ground colours, plain stone, no water bump; 1024 sun shadow"
        },
        "reducedMotion": false
      },
      "toneKnobs": [
        {
          "name": "ragged",
          "in": "module",
          "values": {
            "strict": 0,
            "refined": 0.15,
            "playful": 0.45
          },
          "note": "Terrace edge wandering as a fraction of the step; valley and beach options with the same name instead use metres"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 1.062,
          "cpuMs": 0.28,
          "cpuP95Ms": 0.405,
          "badge": "moderate",
          "drawCalls": 33,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.218,
            "p99Ms": 6.18,
            "low1Fps": 152.1
          },
          "notes": "Default shaped coastal hillside: 160 × 160 m at 0.5 m spacing, relief and baked hollow shade, shadow-casting walls, cliffs and two houses, terrace pools, a stream and gently moving sea. No comparison view or control changes. Planners and hollow baking run only on load or edits, outside the measured render frames."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "intel xe-2lpg",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Microsoft Edge 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 3.211,
          "cpuMs": 0.535,
          "cpuP95Ms": 0.735,
          "badge": "heavy",
          "drawCalls": 33,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Microsoft Edge 157, Chromium 157 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 2183 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 2.124,
          "cpuMs": 0.64,
          "cpuP95Ms": 1.1,
          "badge": "heavy",
          "drawCalls": 33,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 1876 ms."
        }
      ],
      "signatures": [
        {
          "file": "coastline.ts",
          "declarations": "import { type HeightFn, type Point } from './terraces';\nexport type CoastKind = 'beach' | 'cliff';\nexport type CliffForm = 'straight' | 'outer' | 'inner' | 'end';\nexport declare const COAST_CLIFF_PORTS: {\n    readonly 4: {\n        readonly straight: {\n            readonly entry: readonly [\n                -4,\n                -0.1935\n            ];\n            readonly exit: readonly [\n                4,\n                -0.1935\n            ];\n        };\n        readonly outer: {\n            readonly entry: readonly [\n                -3.071911,\n                1.024468\n            ];\n            readonly exit: readonly [\n                0.928089,\n                -2.975532\n            ];\n        };\n        readonly inner: {\n            readonly entry: readonly [\n                -2.75,\n                -1.25\n            ];\n            readonly exit: readonly [\n                1.25,\n                2.75\n            ];\n        };\n        readonly end: {\n            readonly entry: readonly [\n                -4.355,\n                -0.1935\n            ];\n            readonly exit: readonly [\n                4.355,\n                -0.1935\n            ];\n        };\n    };\n    readonly 6: {\n        readonly straight: {\n            readonly entry: readonly [\n                -4,\n                -0.239386\n            ];\n            readonly exit: readonly [\n                4,\n                -0.239386\n            ];\n        };\n        readonly outer: {\n            readonly entry: readonly [\n                -3.062237,\n                1.024468\n            ];\n            readonly exit: readonly [\n                0.937763,\n                -2.975532\n            ];\n        };\n        readonly inner: {\n            readonly entry: readonly [\n                -2.75,\n                -1.25\n            ];\n            readonly exit: readonly [\n                1.25,\n                2.75\n            ];\n        };\n        readonly end: {\n            readonly entry: readonly [\n                -4.355,\n                -0.239386\n            ];\n            readonly exit: readonly [\n                4.355,\n                -0.239386\n            ];\n        };\n    };\n};\nexport type CliffHeight = keyof typeof COAST_CLIFF_PORTS;\nexport interface CoastlineOptions {\n    shore: Point[];\n    ground: HeightFn;\n    seaLevel: number;\n    probe?: number;\n    cliffSlope?: number;\n    minRun?: number;\n    minCliff?: number;\n    highFrom?: number;\n    maxBend?: number;\n    smoothing?: number;\n    step?: number;\n}\nexport declare const COASTLINE_DEFAULTS: {\n    readonly probe: 6;\n    readonly cliffSlope: 0.5;\n    readonly minRun: 20;\n    readonly minCliff: 18;\n    readonly highFrom: 5;\n    readonly maxBend: 10;\n    readonly smoothing: 10;\n    readonly step: 2;\n};\nexport interface CoastStretch {\n    kind: CoastKind;\n    from: number;\n    to: number;\n    points: Point[];\n    height?: CliffHeight;\n}\nexport interface CliffPiece {\n    form: CliffForm;\n    height: CliffHeight;\n    x: number;\n    z: number;\n    yaw: number;\n    mirror: boolean;\n    lift: number;\n    entry: Point;\n    exit: Point;\n}\nexport interface CoastPlan {\n    stretches: CoastStretch[];\n    pieces: CliffPiece[];\n    joints: {\n        x: number;\n        z: number;\n        bend: number;\n    }[];\n}\nexport declare function classifyShore(options: CoastlineOptions): CoastStretch[];\nexport declare function chainCliff(shore: readonly Point[], height: CliffHeight, maxBend?: number, smoothing?: number): {\n    pieces: CliffPiece[];\n    joints: {\n        x: number;\n        z: number;\n        bend: number;\n    }[];\n};\nexport declare function planCoastline(options: CoastlineOptions): CoastPlan;\nexport declare function sideOf(line: readonly Point[], x: number, z: number): {\n    distance: number;\n    side: number;\n    beyond: number;\n    nx: number;\n    nz: number;\n};\nexport declare function sideIndex(line: readonly Point[], reach: number): (x: number, z: number) => {\n    distance: number;\n    side: number;\n    beyond: number;\n    nx: number;\n    nz: number;\n};\nexport declare const SHAPED_SLOPE = 0.55;\nexport declare const CLIFF_SHELF = 3;\nexport declare const EASE_MAX = 150;\nexport declare const CLIFF_WALL: {\n    readonly back: 1.5;\n    readonly front: 1.9;\n    readonly embed: 0.6;\n    readonly under: 0.08;\n};\nexport interface CoastShapeOptions {\n    base?: number;\n    blend?: number;\n    seaLevel: number;\n}\nexport declare function shapeCoast(plan: CoastPlan, ground: HeightFn, options: CoastShapeOptions): {\n    heightAt: HeightFn;\n    base: number;\n};\nexport interface BeachShapeOptions {\n    seaLevel: number;\n    width?: number;\n    slope?: number;\n    offshore?: number;\n    blend?: number;\n    sandFade?: number;\n    ragged?: number;\n    seed?: number;\n}\nexport declare const BEACH_DEFAULTS: {\n    readonly width: 14;\n    readonly slope: number;\n    readonly offshore: 12;\n    readonly blend: 12;\n    readonly sandFade: 3;\n    readonly ragged: 2.5;\n    readonly seed: 7;\n};\nexport declare const SEABED_SLOPE = 0.15;\nexport declare function shapeBeaches(plan: CoastPlan, ground: HeightFn, options: BeachShapeOptions): {\n    heightAt: HeightFn;\n    sandAt: (x: number, z: number) => number;\n};"
        },
        {
          "file": "terraces.ts",
          "declarations": "export type HeightFn = (x: number, z: number) => number;\nexport interface Point {\n    x: number;\n    z: number;\n}\nexport interface TerraceOptions {\n    region: Point[];\n    ground: HeightFn;\n    step?: number;\n    minWidth?: number;\n    ragged?: number;\n    wander?: number;\n    margin?: number;\n    wall?: number;\n    depth?: number;\n    flooded?: number;\n    seed?: number;\n    cell?: number;\n}\nexport interface Bench {\n    id: number;\n    level: number;\n    y: number;\n    water: number | null;\n    area: number;\n    outline: Point[][];\n}\nexport interface Riser {\n    lower: number;\n    upper: number;\n    points: Point[];\n}\nexport interface Terraces {\n    step: number;\n    wall: number;\n    benches: Bench[];\n    risers: Riser[];\n    heightAt: HeightFn;\n    benchAt(x: number, z: number): Bench | null;\n    edgeDistance(x: number, z: number): number;\n}\nexport declare const TERRACE_DEFAULTS: {\n    readonly step: 0.75;\n    readonly minWidth: 2.5;\n    readonly ragged: 0.3;\n    readonly wander: 22;\n    readonly margin: 5;\n    readonly wall: 0.5;\n    readonly depth: 0.12;\n    readonly flooded: 0.75;\n    readonly seed: 1;\n    readonly cell: 0.25;\n};\nexport declare function hash2(i: number, j: number, seed: number): number;\nexport declare function wanderNoise(x: number, z: number, seed: number): number;\nexport declare const smoothstep: (a: number, b: number, t: number) => number;\nexport declare function insidePolygon(polygon: readonly Point[], x: number, z: number): boolean;\nexport declare function segmentDistance(px: number, pz: number, a: Point, b: Point): {\n    distance: number;\n    t: number;\n};\nexport declare function polylineLength(points: readonly Point[]): number;\nexport declare function pointAlong(points: readonly Point[], s: number): {\n    x: number;\n    z: number;\n    dx: number;\n    dz: number;\n};\nexport declare function terraceHillside(options: TerraceOptions): Terraces;\nexport interface WallPlacement {\n    material: 'stone' | 'mud';\n    nominalHeight: 0.5 | 1;\n    x: number;\n    y: number;\n    z: number;\n    yaw: number;\n    scale: {\n        x: number;\n        y: number;\n        z: number;\n    };\n    from: Point;\n    to: Point;\n    curved: boolean;\n}\nexport interface WallOptions {\n    material?: 'stone' | 'mud' | 'mixed';\n    overlap?: number;\n    sink?: number;\n    bund?: number;\n    curveTurn?: number;\n    minLength?: number;\n}\nexport declare const WALL_PROFILE: {\n    chord: number;\n    sagitta: number;\n    turn: number;\n    heights: readonly [\n        0.5,\n        1\n    ];\n    thickness: number;\n};\nexport declare function terraceWalls(terraces: Pick<Terraces, 'risers' | 'wall'>, options?: WallOptions): WallPlacement[];\nexport interface PoolPatch {\n    format: 1;\n    id: string;\n    name: string;\n    materialId: string;\n    x: number;\n    z: number;\n    size: number;\n    fillHeight: number;\n    depths: number[];\n}\nexport interface PoolOptions {\n    materialId: string;\n    bed: HeightFn;\n    maxDepth?: number;\n    tile?: number;\n    idPrefix?: string;\n    name?: string;\n}\nexport declare function terracePools(terraces: Pick<Terraces, 'benches' | 'benchAt' | 'edgeDistance'>, options: PoolOptions): PoolPatch[];"
        },
        {
          "file": "valleys.ts",
          "declarations": "import { type HeightFn, type Point } from './terraces';\nexport interface ValleyOptions {\n    path: Point[];\n    floor: number;\n    floorWidth: number;\n    sideRun: number;\n    ragged?: number;\n    wander?: number;\n    seed?: number;\n}\nexport interface Valley {\n    heightAt: HeightFn;\n    halfFloorAt(x: number, z: number): number;\n    distanceAt(x: number, z: number): number;\n}\nexport declare function carveValley(ground: HeightFn, options: ValleyOptions): Valley;\nexport interface Pad {\n    x: number;\n    z: number;\n    radius: number;\n    y?: number;\n}\nexport interface LevelledPads {\n    heightAt: HeightFn;\n    pads: Required<Pad>[];\n}\nexport declare function levelPads(ground: HeightFn, pads: Pad[], blend?: number): LevelledPads;"
        }
      ],
      "pitfalls": [
        "All coordinates are Y-up metres",
        "Build planners once when inputs change, then sample the final function onto your lattice",
        "Use finite coordinates and dimensions, positive widths, wavelengths",
        "Keep hillside slope below step / minWidth where possible (about 0.3 at defaults)",
        "The order of transforms matters",
        "A valley sets its floor exactly, including filling land below it inside the floor",
        "Wall placements retain a 4 m chord profile, 0.8 m thickness and 0.5/1 m nominal heights",
        "Cliff placements retain fixed reference ports for 4/6 m profiles",
        "Coast shaping keeps a 3 m shelf and ground 0.08 m below cliff caps",
        "Sample pool depths against the stored/interpolated bed your renderer actually uses",
        "The core has no renderer or three dependency"
      ],
      "card": "entries/terrain-shaping.json"
    },
    {
      "id": "text-frost",
      "aliases": [],
      "name": "Frost growing over a word",
      "summary": "Ice crystals that grow over a word, a logo or any shape: a phase-field simulation of solidification (Kobayashi’s) stepped in compute, its branches racing through the shape from seeds and stopping at its edges, then drawn as frost with facets, highlights, glowing tips and glints. Scrub its growth, melt it, or touch to grow more.",
      "category": "simulation",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "phase field",
        "crystal growth",
        "dendrites",
        "kobayashi",
        "compute",
        "wgsl",
        "raw webgpu",
        "text effects"
      ],
      "useCases": [
        "title cards and splash screens",
        "winter and seasonal themes",
        "logo reveals",
        "game menus and loading screens",
        "frozen states in UI (a locked or paused card)"
      ],
      "interaction": "Touch or drag to grow frost where you like · the light follows the pointer",
      "kits": [],
      "pairsWith": [
        {
          "id": "glass-engraving",
          "why": "The same word in glass"
        },
        {
          "id": "circuit-from-text",
          "why": "The same word as a board"
        },
        {
          "id": "cinematic-lens",
          "why": "Bloom on the frost’s sparkle"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 1.706,
          "cpuMs": 0.222,
          "cpuP95Ms": 0.31,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured looping by itself: the word grows over its grow time (about seven phase-field steps a frame on the 640-column grid, more while it melts back), holds, melts and grows again; one draw pass over the word each frame. Timed with its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.328,
          "cpuMs": 0.36,
          "cpuP95Ms": 0.635,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 312 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 7.278,
          "cpuMs": 0.3,
          "cpuP95Ms": 0.5,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 93 ms."
        }
      ],
      "signatures": [
        {
          "file": "frost.ts",
          "declarations": "export type FrostSeed = {\n    x: number;\n    y: number;\n    angle: number;\n    delay: number;\n};\nexport type FrostMask = HTMLCanvasElement | OffscreenCanvas | ImageBitmap | HTMLImageElement;\nexport type FrostOptions = {\n    cols?: number;\n    maxRows?: number;\n    channel?: 'alpha' | 'luma';\n    seeds?: FrostSeed[];\n    seedCount?: number;\n    seed?: number;\n};\nexport type FrostControls = {\n    arms: number;\n    feathering: number;\n    undercooling: number;\n    melt: number;\n};\nexport type FrostLook = {\n    tint?: string;\n    glow?: string;\n    sky?: string;\n    skyAmount?: number;\n    light?: {\n        x: number;\n        y: number;\n        height?: number;\n        strength?: number;\n    };\n    exposure?: number;\n    time?: number;\n    sparkle?: number;\n    pulse?: number;\n    clip?: number;\n    clear?: [\n        number,\n        number,\n        number,\n        number\n    ] | null;\n};\nexport type Frost = {\n    readonly cols: number;\n    readonly rows: number;\n    readonly steps: number;\n    readonly taken: number;\n    readonly pending: number;\n    readonly seeds: FrostSeed[];\n    controls: FrostControls;\n    grow(growth: number, cap?: number): number;\n    run(n: number): void;\n    restart(): void;\n    touch(u: number, v: number, options?: {\n        radius?: number;\n        plant?: boolean;\n        angle?: number;\n    }): void;\n    draw(target: GPUCanvasContext | GPUTextureView, rect: {\n        x: number;\n        y: number;\n        w: number;\n        h: number;\n    }, look?: FrostLook): boolean;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare function maskCoverage(mask: FrostMask, cols: number, rows: number, channel?: 'alpha' | 'luma'): Uint8Array;\nexport declare function seedsFromMask(cover: Uint8Array, cols: number, rows: number, { count, seed }?: {\n    count?: number | undefined;\n    seed?: number | undefined;\n}): FrostSeed[];\nexport declare function createFrost(device: GPUDevice, mask: FrostMask, format: GPUTextureFormat, options?: FrostOptions): Promise<Frost>;"
        },
        {
          "file": "mask.ts",
          "declarations": "export declare function drawWordMask(text: string, { family, weight, px, pad, tracking }?: {\n    family?: string;\n    weight?: number;\n    px?: number;\n    pad?: number;\n    tracking?: number;\n}): HTMLCanvasElement;\nexport declare function drawShapeMask(draw: (g: CanvasRenderingContext2D, size: number) => void, { size, pad }?: {\n    size?: number | undefined;\n    pad?: number | undefined;\n}): HTMLCanvasElement;\nexport declare function drawFrostStill(g: CanvasRenderingContext2D, mask: CanvasImageSource & {\n    width: number;\n    height: number;\n}, rect: {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n}, { tint, glow, blur }?: {\n    tint?: string | undefined;\n    glow?: string | undefined;\n    blur?: number | undefined;\n}): void;"
        }
      ],
      "pitfalls": [
        "The steps are explicit: the source’s DT, DX and constants sit near the edge of stability",
        "Crystals keep their size in cells",
        "Never queue more than one frame ahead",
        "Going back in growth starts again from nothing and catches up (at most `cap` steps a draw)",
        "The mask must have room round the shape (`pad` in drawWordMask)",
        "Load the font before drawing the word mask, or the frost grows over the fallback font",
        "The target is premultiplied alpha"
      ],
      "card": "entries/text-frost.json"
    },
    {
      "id": "textile-frames",
      "aliases": [],
      "name": "Textile frames round panels",
      "summary": "Woven, knitted and embroidered borders for any element: mark it `data-textile=\"twill\"` and its own border becomes cloth, drawn thread by thread on the GPU. Eight plain techniques: plain weave and twill tapes, a rib knit with Vs and purl ridges, cross-stitch on an even-weave ground, running stitch through linen, a glossy satin scallop, a felt band with blanket stitch and french knots, and a twisted cord. Woven ones run along each side and meet on a mitre; stitched ones follow the outline round the corners, fitted so the repeat closes without a seam. Frames sew themselves in behind a needle (woven ones with loose threads running ahead) and unpick again, as promises; running stitch marches while you point at it; a focus stitch in the accent marches round whatever has keyboard focus. Thread colours are custom properties, so they theme with the page. One instanced draw for every frame, on demand; CSS stand-ins where WebGPU is missing.",
      "category": "ui",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "textile",
        "border",
        "frame",
        "weave",
        "twill",
        "knit",
        "cross-stitch",
        "embroidery",
        "running stitch",
        "satin stitch",
        "blanket stitch",
        "cord",
        "dom + gpu",
        "css custom properties",
        "raw webgpu",
        "wgsl",
        "focus",
        "reduced motion",
        "draw on demand",
        "timestamp queries",
        "no dependencies"
      ],
      "useCases": [
        "a warm, handmade look for cards and panels (a craft shop, a recipe app, a knitting counter)",
        "a frame that sews itself in when a panel arrives, or unpicks when it leaves",
        "a decorative focus and hover state that still keeps the real outline",
        "badges, certificates and stickers with a stitched edge",
        "a look (a theme) where the borders carry the personality"
      ],
      "interaction": "Point at a frame or tab to it · Sew in and Unpick at the top · Sew again on a card",
      "kits": [],
      "pairsWith": [
        {
          "id": "noren-banners",
          "why": "Curtains in the same cloth"
        },
        {
          "id": "stitched-dom",
          "why": "Cloth that carries the text"
        },
        {
          "id": "stone-inlay",
          "why": "Stone for the page, cloth for the borders"
        }
      ],
      "variants": [],
      "version": "1.0.2",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "motion",
          "in": "module",
          "values": {
            "strict": 0,
            "refined": 1,
            "playful": 1
          },
          "note": "stitches march on hover and focus at 1"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-13",
          "gpuMs": 0.028,
          "cpuMs": 0.215,
          "cpuP95Ms": 0.345,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured while every frame is being sewn in, over and over (eight bands and a cord, one instanced draw), timed by its own timestamp query."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.066,
          "cpuMs": 0.33,
          "cpuP95Ms": 0.555,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.695,
            "p99Ms": 17.955,
            "low1Fps": 52.9
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 146 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 2.084,
          "cpuMs": 0.28,
          "cpuP95Ms": 0.36,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 182 ms."
        }
      ],
      "signatures": [
        {
          "file": "textile-frames.ts",
          "declarations": "export type TextileFrames = {\n    readonly mode: 'webgpu' | 'css';\n    frame(dt: number): void;\n    refresh(): void;\n    sew(el: HTMLElement, opts?: {\n        duration?: number;\n        reverse?: boolean;\n        delay?: number;\n    }): Promise<void>;\n    motion: number;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare function createTextileFrames(root: HTMLElement, { css, onLost }?: {\n    css?: boolean;\n    onLost?: (message: string) => void;\n}): Promise<TextileFrames>;"
        }
      ],
      "pitfalls": [
        "The frame lives in the element’s border",
        "The canvas sits behind the elements (z-index 0, the elements 1) and draws only the bands",
        "Stitched patterns follow the outline and fit their repeat to its length",
        "The outline coordinate is measured on the outer edge",
        "Colours are read with getComputedStyle when the frames are created and on refresh()",
        "The frames redraw on resize, scroll inside the container, hover, focus and sewing",
        "The focus stitch is decoration",
        "Under reduced motion (or motion = 0), sew() resolves at once and the frame simply appears",
        "A lost device (a driver reset, the GPU process gone) turns the frames into the CSS stand-ins",
        "Name patterns by technique, not by people or places, and do not copy a tradition’s motifs"
      ],
      "card": "entries/textile-frames.json"
    },
    {
      "id": "thin-film",
      "aliases": [],
      "name": "Thin films and gratings",
      "summary": "The rainbow sheen of a soap bubble, oil on water, a silicon wafer, an optical disc and a beetle’s shell, worked out across the spectrum: WGSL functions for a film’s colour (thickness, angle, indices) and a grating’s, with the CIE observer’s analytic fit, and a small WebGPU renderer that shows them on five surfaces (with a GLSL twin on WebGL2 where WebGPU is missing).",
      "category": "surface",
      "role": "hero-visual",
      "stack": [
        "webgpu"
      ],
      "character": "balanced",
      "tags": [
        "thin film",
        "iridescence",
        "diffraction grating",
        "spectral",
        "cie",
        "wgsl",
        "glsl",
        "raw webgpu",
        "webgl2 fallback",
        "ray tracing"
      ],
      "useCases": [
        "soap bubbles and foam",
        "oil, petrol and puddles",
        "coated lenses, glass and metals",
        "chips, wafers and discs",
        "beetles, feathers and pearl",
        "holographic foil and stickers"
      ],
      "interaction": "Move the pointer to move the light (or drag, or the arrow keys) · pick a surface",
      "kits": [
        {
          "kit": "product-presentation",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "card-material",
          "why": "Foil and iridescent finishes on cards"
        },
        {
          "id": "material-designer",
          "why": "Iridescent layers in a material"
        },
        {
          "id": "vehicle-showcase",
          "why": "Iridescent paint on a staged vehicle"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 4.398,
          "cpuMs": 0.107,
          "cpuP95Ms": 0.3,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "All four surfaces side by side with the films flowing and the light swinging: one full-screen pass, each film summed over 12 wavelengths, timed with its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.114,
          "cpuMs": 0.19,
          "cpuP95Ms": 0.42,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 1471 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 6.933,
          "cpuMs": 0.14,
          "cpuP95Ms": 0.84,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 61 ms."
        }
      ],
      "signatures": [
        {
          "file": "thin-film-wgsl.ts",
          "declarations": "export declare function bandsOf(n: number): number[];\nexport declare function cieRgb(l: number): [\n    number,\n    number,\n    number\n];\nexport declare function filmReflectance(nFilm: number, nBase: number, d: number, cosI: number, l: number, absorb?: number): number;\nexport declare function thinFilmRgb(thickness: number, cosTheta: number, nFilm: number, nBase: number, bands?: number): [\n    number,\n    number,\n    number\n];\nexport declare function spectralWgsl(bands?: number): string;\nexport declare const SURFACE_KINDS: readonly [\n    \"bubble\",\n    \"oil\",\n    \"wafer\",\n    \"disc\",\n    \"beetle\"\n];\nexport declare const SCENE_WGSL = \"\\nstruct Scene {\\n  res: vec4f,    // width, height (px), 1 / width, 1 / height\\n  grid: vec4f,   // columns, rows, the surface (-1: the first four in the tiles), time (s)\\n  film: vec4f,   // mean thickness (nm), its variation 0-1, the film's index, the grating's spacing (nm)\\n  light: vec4f,  // the direction to the key light (world, y up), its azimuth (radians)\\n  more: vec4f,   // seed, exposure, device pixel ratio, the key light's brightness\\n};\\n@group(0) @binding(0) var<uniform> S: Scene;\\n\\n@vertex fn vs(@builtin(vertex_index) i: u32) -> @builtin(position) vec4f {\\n  var tri = array<vec2f, 3>(vec2f(-1.0, -1.0), vec2f(3.0, -1.0), vec2f(-1.0, 3.0));\\n  return vec4f(tri[i], 0.0, 1.0);\\n}\\n\\n// ---- Noise ----------------------------------------------------------------------------------------------\\n\\n/** PCG3D (Jarzynski and Olano, 2020): three well-mixed 32-bit values from three. */\\nfn pcg3(v0: vec3u) -> vec3u {\\n  var v = v0 * 1664525u + 1013904223u;\\n  v.x += v.y * v.z; v.y += v.z * v.x; v.z += v.x * v.y;\\n  v ^= v >> vec3u(16u);\\n  v.x += v.y * v.z; v.y += v.z * v.x; v.z += v.x * v.y;\\n  return v;\\n}\\nfn hash3(p: vec3f) -> f32 { return f32(pcg3(bitcast<vec3u>(vec3i(p))).x) * (1.0 / 4294967295.0); }\\nfn vnoise(p: vec3f) -> f32 {\\n  let i = floor(p); let f = fract(p); let u = f * f * (3.0 - 2.0 * f);\\n  let a = mix(mix(hash3(i), hash3(i + vec3f(1.0, 0.0, 0.0)), u.x), mix(hash3(i + vec3f(0.0, 1.0, 0.0)), hash3(i + vec3f(1.0, 1.0, 0.0)), u.x), u.y);\\n  let b = mix(mix(hash3(i + vec3f(0.0, 0.0, 1.0)), hash3(i + vec3f(1.0, 0.0, 1.0)), u.x), mix(hash3(i + vec3f(0.0, 1.0, 1.0)), hash3(i + vec3f(1.0, 1.0, 1.0)), u.x), u.y);\\n  return mix(a, b, u.z);\\n}\\nfn fbm(p: vec3f) -> f32 {\\n  var s = 0.0; var a = 0.5; var q = p;\\n  for (var k = 0; k < 3; k++) { s += a * vnoise(q); q = q * 2.03 + vec3f(17.1, 3.7, 9.2); a *= 0.5; }\\n  return s / 0.875;\\n}\\n/** A film's flow: noise pushed round by slower noise, drifting with time t (0-1 out). */\\nfn swirl(p: vec3f, t: f32) -> f32 {\\n  let q = p + vec3f(S.more.x * 13.7, S.more.x * 7.3, S.more.x * 3.1);\\n  let w = vec3f(vnoise(q * 1.1 + vec3f(0.0, 0.0, t * 0.11)), vnoise(q * 1.1 + vec3f(5.2, 1.3, -t * 0.09)), vnoise(q * 1.1 + vec3f(-3.1, 7.7, t * 0.07))) - 0.5;\\n  return fbm(q * 1.6 + w * 2.6 + vec3f(t * 0.04, -t * 0.06, 0.0));\\n}\\n\\n// ---- The studio -----------------------------------------------------------------------------------------\\n\\n/** A direction into the rig's own frame (the rig turns with the key light's azimuth). */\\nfn rig(r: vec3f) -> vec3f {\\n  let a = S.light.w; let c = cos(a); let s = sin(a);\\n  return vec3f(c * r.x - s * r.z, r.y, s * r.x + c * r.z);\\n}\\n/** A rectangular light seen along r: centred at an azimuth and elevation (degrees; azimuth 0 is -z), its half size (tangents), its edge's softness. */\\nfn softbox(r: vec3f, az: f32, el: f32, hs: vec2f, soft: f32) -> f32 {\\n  let a = az * TF_PI / 180.0; let e = el * TF_PI / 180.0;\\n  let c = vec3f(sin(a) * cos(e), sin(e), -cos(a) * cos(e));\\n  let d = dot(r, c);\\n  if (d <= 0.05) { return 0.0; }\\n  let ax = normalize(vec3f(cos(a), 0.0, sin(a)));\\n  let ay = cross(ax, c);\\n  let q = vec2f(dot(r, ax), dot(r, ay)) / d;\\n  let m = smoothstep(hs + vec2f(soft), hs - vec2f(soft), abs(q));\\n  return m.x * m.y;\\n}\\n/** The room seen along r, blurred by rough: dark, a wide panel far off, a tall one near, one overhead, two strips, the key light. */\\nfn studio(r: vec3f, rough: f32) -> vec3f {\\n  let q = rig(r);\\n  var c = mix(vec3f(0.003, 0.004, 0.006), vec3f(0.035, 0.04, 0.05), smoothstep(-0.3, 0.9, q.y));\\n  c += vec3f(0.85, 0.9, 1.0) * 0.9 * softbox(q, 0.0, 26.0, vec2f(0.95, 0.22), 0.12 + rough);\\n  c += vec3f(1.0, 0.98, 0.95) * 1.2 * softbox(q, 180.0, 32.0, vec2f(0.45, 0.6), 0.14 + rough);\\n  c += vec3f(0.95, 0.96, 1.0) * 0.5 * softbox(q, 0.0, 72.0, vec2f(0.55, 0.55), 0.2 + rough);\\n  c += vec3f(1.0, 0.82, 0.62) * 0.7 * softbox(q, 100.0, 14.0, vec2f(0.1, 0.5), 0.05 + rough);\\n  c += vec3f(0.62, 0.8, 1.0) * 0.7 * softbox(q, -100.0, 18.0, vec2f(0.1, 0.5), 0.05 + rough);\\n  let k = dot(r, S.light.xyz);\\n  // (Blurred, the lamp spreads its light over more of the sky: as bright in all, so dimmer where it is.)\\n  c += vec3f(1.0, 0.97, 0.92) * S.more.w * (smoothstep(cos(0.05 + rough), cos(0.03), k) * 12.0 + pow(max(k, 0.0), 24.0) * 0.12) / (1.0 + rough * rough * 400.0);\\n  return c;\\n}\\n/** Behind everything: near black, a touch lighter above, so the panels show only in reflections. */\\nfn backdrop(r: vec3f) -> vec3f { return mix(vec3f(0.0004, 0.0005, 0.0007), vec3f(0.0016, 0.0019, 0.0026), smoothstep(-0.6, 0.8, r.y)); }\\n\\n// ---- The surfaces ---------------------------------------------------------------------------------------\\n\\nstruct Cam { eye: vec3f, look: vec3f, tanHalf: f32, gain: f32 };\\nfn camOf(kind: i32) -> Cam {\\n  switch kind {\\n    case 0: { return Cam(vec3f(0.0, 0.15, 3.3), vec3f(0.0, 0.0, 0.0), 0.42, 3.2); }\\n    case 1: { return Cam(vec3f(0.0, 1.9, 2.1), vec3f(0.0, 0.0, -0.3), 0.5, 1.1); }\\n    case 2: { return Cam(vec3f(0.0, 1.8, 2.0), vec3f(0.0, 0.0, -0.1), 0.5, 1.3); }\\n    case 3: { return Cam(vec3f(0.0, 1.8, 2.0), vec3f(0.0, 0.0, -0.1), 0.5, 1.1); }\\n    default: { return Cam(vec3f(1.25, 1.45, 2.3), vec3f(0.0, 0.0, 0.0), 0.34, 4.5); }\\n  }\\n}\\n\\n/** The film's thickness (nm) where a point of it is: the mean, varied by the flow. */\\nfn thick(flow: f32, scale: f32) -> f32 { return max(0.0, S.film.x * scale * (1.0 + S.film.y * (flow * 2.0 - 1.0) * 0.95)); }\\n\\n/** A soap bubble: two films (the near face and the far one, seen from inside), thinner at the top as it drains. */\\nfn bubble(ro: vec3f, rd: vec3f) -> vec3f {\\n  let b = dot(ro, rd); let k = b * b - dot(ro, ro) + 1.0;\\n  if (k < 0.0) { return backdrop(rd); }\\n  let t0 = -b - sqrt(k); let t1 = -b + sqrt(k);\\n  let n0 = ro + rd * t0; let n1 = ro + rd * t1;\\n  let time = S.grid.w;\\n  let ior = S.film.z;\\n  let drain0 = mix(1.25, 0.35, smoothstep(-0.9, 1.0, n0.y));\\n  let drain1 = mix(1.25, 0.35, smoothstep(-0.9, 1.0, n1.y));\\n  let d0 = thick(swirl(n0 * 1.4, time), drain0);\\n  let d1 = thick(swirl(n1 * 1.4, time), drain1);\\n  let f0 = thinFilm(d0, clamp(dot(n0, -rd), 0.0, 1.0), ior, 1.0);\\n  let f1 = thinFilm(d1, clamp(dot(n1, rd), 0.0, 1.0), ior, 1.0);\\n  let front = studio(reflect(rd, n0), 0.0);\\n  let back = studio(reflect(rd, -n1), 0.0);\\n  return f0 * front + (1.0 - f0) * (f1 * back + (1.0 - f1) * backdrop(rd));\\n}\\n\\n/** Oil on water: a slick, thinning to nothing at its edge (rings of colour there), on dark water that swells a little. */\\nfn oil(ro: vec3f, rd: vec3f) -> vec3f {\\n  if (rd.y > -1e-4) { return backdrop(rd); }\\n  let t = -ro.y / rd.y;\\n  let p = ro + rd * t;\\n  let time = S.grid.w;\\n  let k1 = vec2f(3.1, 1.2) * 2.0; let k2 = vec2f(-1.4, 2.7) * 2.3;\\n  let a1 = dot(p.xz, k1) - time * 1.1; let a2 = dot(p.xz, k2) - time * 0.9;\\n  let g = 0.004 * (cos(a1) * k1 + cos(a2) * k2);\\n  let n = normalize(vec3f(-g.x, 1.0, -g.y));\\n  let q = p.xz + vec2f(0.0, 0.3);\\n  let shape = fbm(vec3f(q * 0.9, S.more.x * 1.7)) + 0.62 - length(q * vec2f(0.55, 0.8)) * 0.6;\\n  let cover = smoothstep(0.36, 0.66, shape);\\n  let d = thick(swirl(vec3f(q * 1.3, 0.5), time), 1.0) * cover;\\n  let f = thinFilm(d, clamp(dot(n, -rd), 0.0, 1.0), S.film.z, 1.33);\\n  let water = vec3f(0.002, 0.007, 0.009);\\n  let c = f * studio(reflect(rd, n), 0.02) + (1.0 - f) * water;\\n  return mix(c, backdrop(rd), smoothstep(2.2, 4.0, length(p.xz - vec2f(0.0, -0.3))));\\n}\\n\\nconst WAFER_R = 1.0;\\nconst PITCH = 0.2;\\nconst DIE = 0.1967;\\n\\n/** A silicon wafer: an oxide film whose thickness steps with the pattern under it, and its fine arrays as gratings. */\\nfn wafer(ro: vec3f, rd: vec3f) -> vec3f {\\n  if (rd.y > -1e-4) { return backdrop(rd); }\\n  let p = ro + rd * (-ro.y / rd.y);\\n  let r = length(p.xz);\\n  let wo = -rd;\\n  let up = vec3f(0.0, 1.0, 0.0);\\n  let notch = p.z > WAFER_R - 0.03 && abs(p.x) < 0.03 - (WAFER_R - p.z);\\n  if (r > WAFER_R || notch) {\\n    // The chuck under it: dark, matte, a little of the room in it.\\n    let c = studio(reflect(rd, up), 0.5) * 0.004 + vec3f(0.001);\\n    return mix(c, backdrop(rd), smoothstep(1.3, 2.6, r));\\n  }\\n  let g = floor(p.xz / PITCH + 0.5);\\n  let local = p.xz - g * PITCH;\\n  let uv = local / DIE + 0.5;\\n  // Whole dies only, inside the edge's margin.\\n  let far = length(abs(g * PITCH) + vec2f(PITCH * 0.5));\\n  let inDie = all(abs(local) < vec2f(DIE * 0.5)) && far < WAFER_R - 0.02;\\n  let spin = 1.0 + S.film.y * (0.18 * sin(r * 13.0 + S.more.x) + 0.25 * smoothstep(0.75, 1.0, r));\\n  var d = S.film.x * spin;\\n  var logic = 0.0; var memory = 0.0;\\n  if (inDie) {\\n    let edge = min(min(uv.x, 1.0 - uv.x), min(uv.y, 1.0 - uv.y));\\n    if (edge < 0.07) { d *= 1.3; }\\n    else if (uv.x < 0.56) { logic = 1.0; d *= 0.72; }\\n    else if (uv.y < 0.6) { memory = 1.0; d *= 1.12; }\\n    else { d *= 0.5 + 0.1 * hash3(vec3f(g, 3.0)); }\\n  } else if (all(abs(local) < vec2f(DIE * 0.5))) {\\n    // The part-dies round the edge: unpatterned oxide.\\n    d *= 0.9;\\n  } else {\\n    // The lanes between dies: bare silicon, its native oxide a couple of nm.\\n    d = 2.0;\\n  }\\n  let f = thinFilm(d, clamp(wo.y, 0.0, 1.0), S.film.z, 3.9);\\n  var c = f * studio(reflect(rd, up), 0.01);\\n  // The key light's rainbow off the arrays: logic rows one way, memory both ways at half the spacing.\\n  let L = S.light.xyz;\\n  let sp = S.film.w;\\n  var rain = grating(L, wo, vec3f(0.0, 0.0, 1.0), vec3f(1.0, 0.0, 0.0), sp, 0.06) * logic;\\n  rain += (grating(L, wo, vec3f(1.0, 0.0, 0.0), vec3f(0.0, 0.0, 1.0), sp * 0.5, 0.06) + grating(L, wo, vec3f(0.0, 0.0, 1.0), vec3f(1.0, 0.0, 0.0), sp * 0.5, 0.06)) * memory;\\n  c += rain * S.more.w * 1.6;\\n  // The bevel round the edge catching the light.\\n  c += studio(normalize(vec3f(p.x / r, 1.2, p.z / r)), 0.05) * exp(-(WAFER_R - r) / 0.006) * 0.5;\\n  return c;\\n}\\n\\n/** An optical disc: a mirror under clear plastic, its track a spiral of rulings (radial), the hub clear. */\\nfn disc(ro: vec3f, rd: vec3f) -> vec3f {\\n  if (rd.y > -1e-4) { return backdrop(rd); }\\n  let p = ro + rd * (-ro.y / rd.y);\\n  let r = length(p.xz);\\n  let wo = -rd;\\n  let up = vec3f(0.0, 1.0, 0.0);\\n  let refl = studio(reflect(rd, up), 0.0);\\n  if (r > 1.0 || r < 0.075) {\\n    let c = studio(reflect(rd, up), 0.5) * 0.004 + vec3f(0.001);\\n    return mix(c, backdrop(rd), smoothstep(1.3, 2.6, r));\\n  }\\n  // The plastic's own face: a few per cent of the room, everywhere.\\n  let fres = 0.04 + 0.96 * pow(1.0 - clamp(wo.y, 0.0, 1.0), 5.0);\\n  var c = refl * fres;\\n  if (r > 0.33 && r < 0.985) {\\n    let radial = vec3f(p.x, 0.0, p.z) / r;\\n    let tangent = vec3f(-p.z, 0.0, p.x) / r;\\n    c += refl * 0.82 * (1.0 - fres);\\n    c += grating(S.light.xyz, wo, radial, tangent, S.film.w, 0.14) * S.more.w * 2.2 * (1.0 - fres);\\n    // (The wide far panel too, its middle, weaker: rainbows of the room as well as of the lamp.)\\n    let a = S.light.w; let e = 26.0 * TF_PI / 180.0;\\n    let panel = vec3f(-sin(a) * cos(e), sin(e), -cos(a) * cos(e));\\n    c += grating(panel, wo, radial, tangent, S.film.w, 0.12) * 0.15 * (1.0 - fres);\\n  } else if (r > 0.17 && r < 0.33) {\\n    // The clamping ring: frosted plastic.\\n    c += studio(reflect(rd, up), 0.25) * 0.05 + vec3f(0.006);\\n  }\\n  // The rims catching the light.\\n  c += refl * (exp(-abs(r - 0.985) / 0.004) + exp(-abs(r - 0.33) / 0.003) * 0.3) * 0.4;\\n  return c;\\n}\\n\\nconst SHELL = vec3f(0.62, 0.42, 0.95);\\n/** A beetle's shell: a film over a dark base, its two wing cases parted by a seam, dimpled in rows. */\\nfn beetle(ro: vec3f, rd: vec3f) -> vec3f {\\n  let o = ro / SHELL; let v = rd / SHELL;\\n  let a = dot(v, v); let b = dot(o, v); let k = b * b - a * (dot(o, o) - 1.0);\\n  if (k < 0.0) { return backdrop(rd); }\\n  let t = (-b - sqrt(k)) / a;\\n  let p = ro + rd * t;\\n  if (p.y < -0.05) { return backdrop(rd); }\\n  var n = normalize(p / (SHELL * SHELL));\\n  // Rows of dimples along the wing cases, and the seam between them.\\n  let row = p.x * 38.0;\\n  let pit = sin(row) * sin(p.z * 46.0 + floor(row / 3.14159) * 1.7);\\n  n = normalize(n + vec3f(cos(row) * 0.05, 0.0, pit * 0.03) * smoothstep(0.02, 0.06, abs(p.x)));\\n  let seam = smoothstep(0.004, 0.012, abs(p.x));\\n  let d = S.film.x * (1.0 + S.film.y * 0.3 * (fbm(p * 1.6 + vec3f(S.more.x)) - 0.5)) * (0.85 + 0.15 * (1.0 - seam));\\n  let f = thinFilm(d, clamp(dot(n, -rd), 0.0, 1.0), S.film.z, 2.0);\\n  return (f * studio(reflect(rd, n), 0.06) + vec3f(0.002)) * mix(0.25, 1.0, seam);\\n}\\n\\nfn surface(kind: i32, ro: vec3f, rd: vec3f) -> vec3f {\\n  switch kind {\\n    case 0: { return bubble(ro, rd); }\\n    case 1: { return oil(ro, rd); }\\n    case 2: { return wafer(ro, rd); }\\n    case 3: { return disc(ro, rd); }\\n    default: { return beetle(ro, rd); }\\n  }\\n}\\n\\n@fragment fn fs(@builtin(position) fc: vec4f) -> @location(0) vec4f {\\n  let cols = S.grid.x; let rows = S.grid.y;\\n  let tile = S.res.xy / vec2f(cols, rows);\\n  let cell = min(floor(fc.xy / tile), vec2f(cols - 1.0, rows - 1.0));\\n  let lp = fc.xy - cell * tile;\\n  var kind = i32(S.grid.z);\\n  // (All four: the bubble, the wafer, the oil, the disc, left to right and top down.)\\n  var order = array<i32, 4>(0, 2, 1, 3);\\n  if (kind < 0) { kind = order[min(i32(cell.y * cols + cell.x), 3)]; }\\n  let aspect = tile.x / tile.y;\\n  let ndc = vec2f((lp.x / tile.x * 2.0 - 1.0) * aspect, 1.0 - lp.y / tile.y * 2.0);\\n  let cam = camOf(kind);\\n  let fwd = normalize(cam.look - cam.eye);\\n  let right = normalize(cross(fwd, vec3f(0.0, 1.0, 0.0)));\\n  let up = cross(right, fwd);\\n  // (A tall tile keeps the surface's width in view.)\\n  let th = cam.tanHalf * max(1.0, 1.0 / aspect);\\n  let rd = normalize(fwd + (right * ndc.x + up * ndc.y) * th);\\n  var c = surface(kind, cam.eye, rd) * cam.gain * S.more.y;\\n  // Tone, gutters between the tiles, a little dither against banding.\\n  c = 1.0 - exp(-max(c, vec3f(0.0)));\\n  if (S.grid.z < 0.0) {\\n    let edge = min(min(lp.x, tile.x - lp.x), min(lp.y, tile.y - lp.y));\\n    c *= smoothstep(0.0, 2.0 * S.more.z, edge);\\n  }\\n  let dither = (hash3(vec3f(fc.xy, 7.0)) - 0.5) / 255.0;\\n  return vec4f(pow(c, vec3f(1.0 / 2.2)) + dither, 1.0);\\n}\\n\";"
        },
        {
          "file": "thin-film.ts",
          "declarations": "import { SURFACE_KINDS } from './thin-film-wgsl';\nexport type SurfaceKind = (typeof SURFACE_KINDS)[number];\nexport type ThinFilmView = SurfaceKind | 'all';\nexport type ThinFilmLook = {\n    view?: ThinFilmView;\n    thickness?: number;\n    variation?: number;\n    ior?: number;\n    density?: number;\n    light?: {\n        azimuth: number;\n        elevation: number;\n    };\n    time?: number;\n    seed?: number;\n    exposure?: number;\n    lamp?: number;\n};\nexport type ThinFilmOptions = {\n    device?: GPUDevice;\n    bands?: number;\n    webgl?: boolean;\n};\nexport type ThinFilm = {\n    readonly api: 'webgpu' | 'webgl2';\n    readonly device: GPUDevice | null;\n    draw(look?: ThinFilmLook): void;\n    setBands(bands: number): Promise<void>;\n    tiles(view?: ThinFilmView): {\n        cols: number;\n        rows: number;\n        kinds: SurfaceKind[];\n    };\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare const ALL_SURFACES: SurfaceKind[];\nexport declare function tilesFor(width: number, height: number): {\n    cols: number;\n    rows: number;\n};\nexport declare function createThinFilm(canvas: HTMLCanvasElement, options?: ThinFilmOptions): Promise<ThinFilm | null>;\nexport declare function createThinFilmGL(canvas: HTMLCanvasElement, options?: Pick<ThinFilmOptions, 'bands'>): Promise<ThinFilm | null>;"
        }
      ],
      "pitfalls": [
        "thinFilm returns a tint, not a colour",
        "Thickness is in nanometres and the wavelengths are too",
        "cosTheta is between the normal and the eye, in the outer medium (air)",
        "The film’s base matters as much as the film",
        "A grating needs a small, bright light",
        "The CIE fit gives some negative sRGB at the spectrum’s pure colours",
        "The renderer draws at the canvas’s own width and height",
        "Never more than one draw on the GPU at a time",
        "Without WebGPU the renderer draws with WebGL2 from thin-film-glsl.ts"
      ],
      "card": "entries/thin-film.json"
    },
    {
      "id": "throw-to-commit",
      "aliases": [],
      "name": "Throw to commit",
      "summary": "Drag a card and throw it at a tray, a folder or a bin to act on it: it lands when let go near one, or when thrown fast enough and on aim; otherwise it springs back. Velocity from recent samples, an aim cone per target, a magnet, live highlights, a sideways swipe for the next item, and every move also a button, a key and an announcement.",
      "category": "ui",
      "role": "interaction",
      "stack": [
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "gestures",
        "drag and drop",
        "fling",
        "velocity",
        "touch",
        "keyboard",
        "accessibility",
        "web animations",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "inbox and triage screens",
        "kanban columns and folders",
        "photo culling",
        "flash cards and review queues",
        "buy and confirm slots",
        "touch kiosks"
      ],
      "interaction": "Drag the top card onto a tray or throw it at one · swipe sideways for the next · or press 1 2 3, ↑ ↓ Enter, ← →",
      "kits": [
        {
          "kit": "shop",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "card-springs",
          "why": "Cards that spring back when the throw misses"
        },
        {
          "id": "labelled-undo",
          "why": "Undo a throw by name"
        },
        {
          "id": "ui-sounds",
          "why": "A whoosh and a landing"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "motion",
          "in": "module",
          "values": {
            "strict": "reduced",
            "playful": "full"
          }
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.80",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-03",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 0.71,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the demo throwing for itself: a scripted pointer drags the top card and throws it at a tray about every 2.4 s, then undoes it, so the frames hold the per-move work (velocity, aim at three trays, the highlight and the aim overlay), the flight in and the return."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 1.52,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 50 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 2.24,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 68 ms."
        }
      ],
      "signatures": [
        {
          "file": "throwable.ts",
          "declarations": "export type ThrowHow = 'near' | 'throw' | 'button' | 'key' | 'code';\nexport type AsideHow = 'swipe' | 'key' | 'code';\nexport type ThrowState = 'idle' | 'pressed' | 'dragging' | 'busy' | 'done';\nexport type ThrowTarget = {\n    id: string;\n    el: HTMLElement;\n    label: string;\n    key?: string;\n    button?: HTMLElement | null;\n    accepts?(card: HTMLElement): boolean | string;\n};\nexport type TargetAim = {\n    id: string;\n    x: number;\n    y: number;\n    rect: DOMRect;\n    dist: number;\n    aim: number;\n    near: boolean;\n    hot: number;\n};\nexport type AimInfo = {\n    phase: 'move' | 'release';\n    x: number;\n    y: number;\n    dx: number;\n    dy: number;\n    ox: number;\n    oy: number;\n    vx: number;\n    vy: number;\n    speed: number;\n    targets: TargetAim[];\n    land: {\n        id: string;\n        how: 'near' | 'throw';\n    } | null;\n    aside: 1 | -1 | 0;\n};\nexport type ThrowMessages = {\n    commit(target: ThrowTarget, how: ThrowHow, card: HTMLElement): string;\n    refuse(target: ThrowTarget, reason: string, card: HTMLElement): string;\n    select(target: ThrowTarget, card: HTMLElement): string;\n    aside(dir: 1 | -1, card: HTMLElement): string;\n    hint(targets: ThrowTarget[], aside: boolean): string;\n};\nexport type ThrowOptions = {\n    targets: ThrowTarget[];\n    speed?: number;\n    aim?: number;\n    reach?: number;\n    pull?: number;\n    slop?: number;\n    window?: number;\n    aside?: {\n        distance?: number;\n        speed?: number;\n    };\n    motion?: 'auto' | 'full' | 'reduced';\n    flightMs?: number;\n    springMs?: number;\n    keys?: boolean;\n    announce?: boolean | ((text: string) => void);\n    messages?: Partial<ThrowMessages>;\n    onCommit?(target: ThrowTarget, how: ThrowHow, card: HTMLElement): void | Promise<void>;\n    onCancel?(card: HTMLElement): void;\n    onRefuse?(target: ThrowTarget, reason: string, card: HTMLElement): void;\n    onAside?(dir: 1 | -1, how: AsideHow, card: HTMLElement): void | Promise<void>;\n    onAim?(info: AimInfo | null): void;\n    onDragStart?(card: HTMLElement): void;\n};\nexport type Thrower = {\n    readonly options: ThrowOptions;\n    readonly state: ThrowState;\n    commit(id: string, how?: ThrowHow): Promise<boolean>;\n    aside(dir: 1 | -1, how?: AsideHow): Promise<void>;\n    choose(id: string | null): void;\n    cancel(): void;\n    stop(): void;\n};\nexport declare const reducedMotion: () => boolean;\nexport declare function liveRegion(host?: HTMLElement): {\n    el: HTMLSpanElement;\n    say(text: string): void;\n    stop: () => void;\n};\nexport declare function shake(el: HTMLElement, { px, motion }?: {\n    px?: number | undefined;\n    motion?: boolean | undefined;\n}): void;\nexport declare function arrive(el: HTMLElement, from: HTMLElement, { motion, ms }?: {\n    motion?: boolean | undefined;\n    ms?: number | undefined;\n}): Animation;\nexport declare function throwable(card: HTMLElement, options: ThrowOptions): Thrower;"
        }
      ],
      "pitfalls": [
        "Always give every target a button or a key as well",
        "The card sets touch-action",
        "The module writes the card’s transform while it is dragged and flown",
        "An ancestor with overflow",
        "Targets are measured when a drag starts",
        "Speed thresholds are in CSS px per ms, not device pixels",
        "A drag of a few pixels is still a click",
        "onCommit runs after the flight"
      ],
      "card": "entries/throw-to-commit.json"
    },
    {
      "id": "tilted-dom-gpu",
      "aliases": [],
      "name": "GPU light on tilted DOM",
      "summary": "WebGPU drawing (WebGL2 where it is missing) that stays locked to DOM panels tilted in CSS 3D: four empty probe elements at each panel’s corners give its projected quad through getBoundingClientRect, and an instanced shader maps every pixel back onto the panel (a homography) for edge glows, corner brackets, a sheen that slides as it turns, pointer light and a scan.",
      "category": "technique",
      "role": "system",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "css 3d",
        "perspective",
        "homography",
        "projective mapping",
        "getBoundingClientRect",
        "dom + gpu",
        "raw webgpu",
        "wgsl",
        "glsl",
        "webgl2 fallback",
        "glow"
      ],
      "useCases": [
        "spatial and holographic interfaces",
        "tilting cards and hero panels",
        "game menus and HUDs",
        "dashboards with depth",
        "highlighting DOM in 3D product tours"
      ],
      "interaction": "Move the pointer to tilt the panels · hover or Tab to lift one",
      "kits": [
        {
          "kit": "product-presentation",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "css-locked-stage",
          "why": "3D locked to the page’s CSS pixels"
        },
        {
          "id": "stone-inlay",
          "why": "GPU material behind ordinary DOM"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "mixed",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 0.074,
          "cpuMs": 0.265,
          "cpuP95Ms": 0.37,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the panels swinging by themselves and a scan running: four panels’ corner probes read each frame and one instanced draw of four quads, timed with its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.131,
          "cpuMs": 0.44,
          "cpuP95Ms": 0.71,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.658,
            "p99Ms": 17.985,
            "low1Fps": 55.5
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 109 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 4.713,
          "cpuMs": 0.82,
          "cpuP95Ms": 0.96,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 74 ms."
        }
      ],
      "signatures": [
        {
          "file": "projective.ts",
          "declarations": "export type Mat3 = Float32Array;\nexport type Corners = ArrayLike<number>;\nexport declare function squareToQuad(p: Corners): Mat3 | null;\nexport declare function invert(m: Mat3): Mat3 | null;\nexport declare function quadToSquare(p: Corners): Mat3 | null;\nexport declare function apply(m: Mat3, x: number, y: number): {\n    x: number;\n    y: number;\n    w: number;\n};"
        },
        {
          "file": "quad-glow.ts",
          "declarations": "import type { Quad } from './track-quads';\nexport type GlowLook = {\n    colour: string;\n    colour2: string;\n    glow: number;\n    rim: number;\n    sheen: number;\n    sheenAngle?: number;\n    sheenOffset?: number;\n    pointer?: {\n        x: number;\n        y: number;\n    } | null;\n    light?: number;\n    hot?: ArrayLike<number>;\n    scan?: ArrayLike<number>;\n};\nexport type QuadGlow = {\n    readonly api: 'webgpu' | 'webgl2';\n    canvas: HTMLCanvasElement;\n    fit(): boolean;\n    render(quads: readonly Quad[], look: GlowLook): boolean;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport declare function createQuadGlow(host: HTMLElement, { z, webgl }?: {\n    z?: number | undefined;\n    webgl?: boolean | undefined;\n}): Promise<QuadGlow | null>;\nexport declare function createQuadGlowGL(host: HTMLElement, { z }?: {\n    z?: number | undefined;\n}): Promise<QuadGlow | null>;"
        },
        {
          "file": "track-quads.ts",
          "declarations": "export type Quad = {\n    el: HTMLElement;\n    p: Float32Array;\n    width: number;\n    height: number;\n    radius: number;\n    visible: boolean;\n};\nexport type QuadTracker = {\n    readonly quads: Quad[];\n    read(force?: boolean): boolean;\n    invalidate(): void;\n    readonly scale: number;\n    dispose(): void;\n};\nexport type TrackOptions = {\n    target?: HTMLElement;\n    watch?: Element[];\n    probeClass?: string;\n};\nexport declare function trackQuads(elements: Iterable<HTMLElement>, { target, watch, probeClass }?: TrackOptions): QuadTracker;"
        }
      ],
      "pitfalls": [
        "A probe is a point only while it has no size",
        "Reading a rect forces style and layout",
        "The tracker reads only when something can have moved",
        "An animation with fill: forwards stays in getAnimations()",
        "A panel turned past 90°, or with a corner behind the viewer",
        "overflow: hidden, opacity < 1, filter or backdrop-filter on an ancestor between the perspective…",
        "The light is added over the panels (additive, premultiplied)",
        "Without WebGPU the light is drawn with WebGL2 from quad-glsl.ts"
      ],
      "card": "entries/tilted-dom-gpu.json"
    },
    {
      "id": "transform-rig",
      "aliases": [],
      "name": "Pick and transform rig",
      "summary": "Click an object to pick it, then move, turn or size it with the gizmo or the Blender way: G, R or S starts a gesture that follows the pointer with no button held, X, Y or Z holds it to an axis, typed digits or the arrow keys give exact amounts, Enter or a click keeps it and Esc or a right click puts it back. Every gesture, by hand or by key, reaches the app once with its pose before and after, so it is one undo step. Picking sees each press before the orbit controls and the gizmo capture the pointer, so a drag that orbits never picks and a tap on the gizmo never picks what is behind it. three.js TransformControls on WebGPU (or WebGL).",
      "category": "ui",
      "role": "interaction",
      "stack": [
        "three",
        "dom"
      ],
      "character": "calm",
      "tags": [
        "3D editor",
        "gizmo",
        "TransformControls",
        "OrbitControls",
        "picking",
        "raycasting",
        "Blender keys",
        "keyboard",
        "modal gesture",
        "undo",
        "one undo step per gesture",
        "snapping",
        "pointer capture",
        "touch",
        "WebGPU",
        "three.js",
        "no dependencies"
      ],
      "useCases": [
        "a scene or level editor in the browser",
        "arranging products, furniture or props in a configurator",
        "placing objects on a 3D slide or stage",
        "a debug tool to nudge things in a running game",
        "giving Blender users the keys their hands already know",
        "any 3D view where a click picks and a drag orbits"
      ],
      "interaction": "Click an object, drag a handle · or G R S, move the mouse, X Y Z, Enter · Ctrl Z undoes",
      "kits": [
        {
          "kit": "product-presentation",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "ray-grid",
          "why": "Picking that stays fast in big scenes"
        },
        {
          "id": "labelled-undo",
          "why": "Undo each gesture by name"
        },
        {
          "id": "smart-guides",
          "why": "Snapping for the 2D side of the editor"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 0.509,
          "cpuMs": 0.425,
          "cpuP95Ms": 0.655,
          "badge": "moderate",
          "drawCalls": 21,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 4.015,
            "p99Ms": 8.025,
            "low1Fps": 104.5
          },
          "notes": "Measured turning the objects by itself: every 2.4 s the next object is picked and a keyboard rotate gesture follows a pointer round it for 1.6 s, then is kept as one undo step. Six objects, a gizmo and a selection box, shadows from one sun."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.245,
          "cpuMs": 0.93,
          "cpuP95Ms": 1.475,
          "badge": "moderate",
          "drawCalls": 21,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 6.255,
            "p99Ms": 10.95,
            "low1Fps": 69.3
          },
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 272 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 1.499,
          "cpuMs": 0.18,
          "cpuP95Ms": 0.22,
          "badge": "moderate",
          "drawCalls": 34,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 433 ms."
        }
      ],
      "signatures": [
        {
          "file": "history.ts",
          "declarations": "export type HistorySnapshot = {\n    undoLabel: string | null;\n    redoLabel: string | null;\n    past: string[];\n    future: string[];\n    canUndo: boolean;\n    canRedo: boolean;\n    holding: boolean;\n    version: number;\n};\nexport type HistoryOptions = {\n    limit?: number;\n    mergeMs?: number;\n};\nexport type HistoryHold = {\n    release(label?: string): void;\n    cancel(): void;\n};\nexport declare function createHistory(options?: HistoryOptions): {\n    record: (label: string, undo: () => void, redo: () => void) => void;\n    run(label: string, redo: () => void, undo: () => void): void;\n    hold(label: string): HistoryHold;\n    undo(): void;\n    redo(): void;\n    jump(steps: number): void;\n    stopMerging(): void;\n    clear(): void;\n    undoLabel: () => string | null;\n    redoLabel: () => string | null;\n    canUndo: () => boolean;\n    canRedo: () => boolean;\n    limit: number;\n    mergeMs: number;\n    subscribe(listener: () => void): () => undefined;\n    getSnapshot: () => HistorySnapshot;\n};\nexport type History = ReturnType<typeof createHistory>;"
        },
        {
          "file": "modal.ts",
          "declarations": "import { Matrix4, Quaternion, Ray, Vector3, type Camera } from 'three';\nexport type ModalKind = 'translate' | 'rotate' | 'scale';\nexport type Axis = 'x' | 'y' | 'z';\nexport type Pose = {\n    position: [\n        number,\n        number,\n        number\n    ];\n    quaternion: [\n        number,\n        number,\n        number,\n        number\n    ];\n    scale: [\n        number,\n        number,\n        number\n    ];\n};\nexport type ModalState = {\n    kind: ModalKind;\n    axis: Axis | null;\n    typed: string;\n    snap: boolean;\n};\nexport type ModalSteps = {\n    translate: [\n        number,\n        number\n    ];\n    rotate: [\n        number,\n        number\n    ];\n    scale: [\n        number,\n        number\n    ];\n};\nexport declare const DEFAULT_STEPS: ModalSteps;\nexport type KeyLike = {\n    key: string;\n    shiftKey?: boolean;\n    ctrlKey?: boolean;\n    metaKey?: boolean;\n    altKey?: boolean;\n};\nexport type ModalAction = 'confirm' | 'cancel' | 'changed' | 'ignored';\nexport declare const startModal: (kind: ModalKind, snap?: boolean) => ModalState;\nexport declare function typedNumber(state: ModalState): number | null;\nexport declare function modalKey(state: ModalState, e: KeyLike, current?: number, steps?: ModalSteps): {\n    state: ModalState;\n    action: ModalAction;\n};\nexport type ModalStart = {\n    pose: Pose;\n    worldPosition: Vector3;\n    worldQuaternion: Quaternion;\n    parentWorld: Matrix4;\n    pointer: {\n        x: number;\n        y: number;\n    };\n};\nexport type ModalView = {\n    camera: Camera;\n    width: number;\n    height: number;\n};\nexport type ModalSnap = {\n    translate?: number | null;\n    rotate?: number | null;\n    scale?: number | null;\n};\nexport type ModalResult = {\n    pose: Pose;\n    value: number;\n    unit: 'm' | '°' | '×';\n};\nexport declare function pointerRay(view: ModalView, p: {\n    x: number;\n    y: number;\n}): Ray;\nexport declare function toScreen(view: ModalView, world: Vector3): {\n    x: number;\n    y: number;\n};\nexport declare const screenAngle: (centre: {\n    x: number;\n    y: number;\n}, p: {\n    x: number;\n    y: number;\n}) => number;\nexport declare const angleStep: (from: number, to: number) => number;\nexport declare function solveModal(state: ModalState, start: ModalStart, view: ModalView, pointer: {\n    x: number;\n    y: number;\n}, turned: number, snap?: ModalSnap): ModalResult;\nexport declare function alongAxis(ray: Ray, origin: Vector3, axis: Vector3): number | null;\nexport declare function gestureLabel(kind: ModalKind, name: string, value: number | null, axis: string | null): string;\nexport declare function describeModal(state: ModalState, value: number): string;\nexport declare function readPose(o: {\n    position: Vector3;\n    quaternion: Quaternion;\n    scale: Vector3;\n}): Pose;\nexport declare function applyPose(o: {\n    position: Vector3;\n    quaternion: Quaternion;\n    scale: Vector3;\n    updateMatrixWorld?: (force?: boolean) => void;\n}, pose: Pose): void;\nexport declare function samePose(a: Pose, b: Pose, eps?: number): boolean;"
        },
        {
          "file": "transform-rig.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { OrbitControls } from 'three/addons/controls/OrbitControls.js';\nimport { applyPose, readPose } from './modal';\nimport type { ModalKind, ModalSnap, ModalState, ModalSteps, Pose } from './modal';\nexport type RigMode = 'select' | ModalKind;\nexport type Gesture = {\n    object: THREE.Object3D;\n    kind: ModalKind;\n    label: string;\n    before: Pose;\n    after: Pose;\n    via: 'gizmo' | 'keys';\n};\nexport type ModalInfo = {\n    object: THREE.Object3D;\n    state: ModalState;\n    value: number;\n    text: string;\n};\nexport type TransformRigOptions = {\n    camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;\n    canvas: HTMLCanvasElement;\n    scene: THREE.Object3D;\n    orbit?: OrbitControls | null;\n    pickable: () => THREE.Object3D[];\n    surface?: HTMLElement;\n    keyTarget?: HTMLElement;\n    mode?: RigMode;\n    snap?: ModalSnap;\n    snapping?: boolean;\n    steps?: ModalSteps;\n    constrain?: (object: THREE.Object3D) => void;\n    nameOf?: (object: THREE.Object3D) => string;\n    onSelect?: (object: THREE.Object3D | null) => void;\n    onMode?: (mode: RigMode) => void;\n    onChange?: (object: THREE.Object3D) => void;\n    onGesture?: (gesture: Gesture) => void;\n    onModal?: (info: ModalInfo | null) => void;\n    onNotice?: (text: string) => void;\n    colour?: THREE.ColorRepresentation;\n    gizmoSize?: number;\n    reducedMotion?: boolean;\n};\nexport declare function createTransformRig(options: TransformRigOptions): {\n    warm: (renderer: {\n        compileAsync(scene: THREE.Object3D, camera: THREE.Camera): Promise<unknown>;\n    }, root?: THREE.Object3D) => Promise<void>;\n    readonly selected: THREE.Object3D<THREE.Object3DEventMap> | null;\n    readonly mode: RigMode;\n    readonly busy: boolean;\n    select: (object: THREE.Object3D | null) => void;\n    setMode: (next: RigMode) => void;\n    begin: (kind: ModalKind) => undefined;\n    confirm: () => void;\n    cancel: () => void;\n    frame: (object?: THREE.Object3D<THREE.Object3DEventMap> | null) => void;\n    setSnapping(on: boolean, steps?: ModalSnap): void;\n    setSpace(space: \"world\" | \"local\"): void;\n    setGizmoSize(size: number): void;\n    setColour(colour: THREE.ColorRepresentation): void;\n    reducedMotion: boolean;\n    pointerAt(x: number, y: number): void;\n    refresh(): void;\n    update(dt?: number): void;\n    dispose(): void;\n};\nexport type TransformRig = ReturnType<typeof createTransformRig>;\nexport { applyPose, readPose, type Pose };"
        }
      ],
      "pitfalls": [
        "Never pick on `click`",
        "Read the gizmo’s claim at the right moment",
        "One undo step per gesture",
        "End a gizmo drag yourself when something cuts it short",
        "A move held to an axis that points almost straight at the viewer swings far for a small pointer…",
        "A second finger is never a pick",
        "Switch the orbit off while the gizmo drags",
        "Listen for G, R and S on the view (a focusable canvas), not on the window",
        "Add `transform.getHelper()` to the scene (r169 and later), not the controls themselves",
        "A keyboard gesture started from the keyboard alone has no pointer to follow",
        "A keyboard turn goes the way the pointer goes round as seen",
        "The gizmo’s materials are compiled the first time it is drawn",
        "A lens shift (`camera.setViewOffset`, to centre the picture beside a side panel) is fine for…"
      ],
      "card": "entries/transform-rig.json"
    },
    {
      "id": "traversal",
      "aliases": [],
      "name": "Vault, climb and mantle without clips",
      "summary": "Getting over and up things with no animation clips and no jump. An edge finder looks ahead along the way for a face, squares the body up to it and measures the top: a thin top with somewhere to land is vaulted (running on, mid-stride, out of a run), a deep one is stepped onto, knee-ed onto or mantled onto, and from waist-deep water the same heave takes longer with the legs kicking. Each move is a short list of whole-body keys built from the body’s own measurements in the edge’s frame, hands put exactly on the lip, the torso bent until the arms reach, and eased through by a monotone cubic so anything held still between keys stays exactly still. Between moves, a walk plants each foot where the body will be, on the real ground, up a kerb and down stairs. A jointed mannequin crosses an obstacle course.",
      "category": "simulation",
      "role": "system",
      "stack": [
        "three"
      ],
      "character": "balanced",
      "tags": [
        "traversal",
        "parkour",
        "vault",
        "mantle",
        "climb",
        "step up",
        "ledge",
        "foot placement",
        "procedural animation",
        "locomotion",
        "inverse kinematics",
        "two-bone ik",
        "monotone cubic",
        "fritsch-carlson",
        "mannequin",
        "fixed timestep",
        "three.js",
        "no dependencies"
      ],
      "useCases": [
        "a third-person character that climbs onto anything of the right height, with no authored clips",
        "NPCs whose path crosses fences, low walls and decks",
        "getting out of a pool, a river or a harbour onto a bank or a deck",
        "level design: a planner that says which edges a body can take, and how",
        "stairs and kerbs walked with feet that land on each step",
        "scrubbing a move key by key to tune it"
      ],
      "interaction": "Watch it cross the course · change the block’s height · Pause in a move and scrub it · orbit to look round",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "humanoid-rig",
          "why": "The rig that vaults and climbs"
        },
        {
          "id": "game-cameras",
          "why": "Cameras that stay clear while climbing"
        },
        {
          "id": "heightfield-chunks",
          "why": "Ground and ledges to climb"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-13",
          "gpuMs": 0.725,
          "cpuMs": 0.3,
          "cpuP95Ms": 0.465,
          "badge": "moderate",
          "drawCalls": 19,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Crosses the whole course at a jog, again and again: the walk’s foot placement on the fixed 60 Hz tick, the edge finder on the way, each move sampled every tick (monotone cubic over its keys), the mannequin solved by two-bone IK and drawn as three instanced meshes, one shadowed key light and a room environment."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 2.032,
          "cpuMs": 0.778,
          "cpuP95Ms": 1.125,
          "badge": "heavy",
          "drawCalls": 22,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 364 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 1.515,
          "cpuMs": 0.12,
          "cpuP95Ms": 0.26,
          "badge": "moderate",
          "drawCalls": 14,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 530 ms."
        }
      ],
      "signatures": [
        {
          "file": "body-frame.ts",
          "declarations": "import { type Vec3 } from './math';\nexport type StanceBody = {\n    thigh: number;\n    shin: number;\n    upperArm: number;\n    forearm: number;\n    hips: Vec3;\n    spine: Vec3;\n    chest: Vec3;\n    legRoots: [\n        Vec3,\n        Vec3\n    ];\n    shoulders: [\n        Vec3,\n        Vec3\n    ];\n    ankles: [\n        Vec3,\n        Vec3\n    ];\n    ballY: number;\n    ballZ: number;\n    stanceWidth: number;\n    toeOut: number;\n    neck: Vec3;\n    head: Vec3;\n};\nexport declare const REFERENCE_BODY: StanceBody;\nexport declare const REFERENCE_SCALE = 0.89;\nexport type BodyLegTarget = {\n    ankle: Vec3;\n    yaw: number;\n    pitch: number;\n    toe: number;\n    heel: number;\n    pole: Vec3;\n};\nexport type BodyTargets = {\n    pelvis: Vec3;\n    pelvisPitch: number;\n    pelvisYaw: number;\n    pelvisRoll: number;\n    spinePitch: number;\n    spineYaw: number;\n    spineRoll: number;\n    headPitch: number;\n    headYaw: number;\n    legs: [\n        BodyLegTarget,\n        BodyLegTarget\n    ];\n};\nexport declare function createBodyTargets(): BodyTargets;\nexport type StanceArm = {\n    weight: number;\n    hand: Vec3;\n    pole: Vec3;\n};\nexport type StanceKey = {\n    body: BodyTargets;\n    arms: [\n        StanceArm,\n        StanceArm\n    ];\n};\nexport declare function createStanceKey(): StanceKey;\nexport declare function rotate(pitch: number, yaw: number, roll: number, vec: Vec3, out: Vec3): Vec3;\nexport declare function legRoot(body: StanceBody, t: BodyTargets, side: 0 | 1, out: Vec3): Vec3;\nexport declare function trunkPoint(body: StanceBody, t: BodyTargets, rest: Vec3, at: 'spine' | 'chest' | 'upper', out: Vec3): Vec3;\nexport declare function shoulderAt(body: StanceBody, t: BodyTargets, side: 0 | 1, out: Vec3): Vec3;\nexport declare function blendKeys(a: StanceKey, b: StanceKey, u: number, out: StanceKey): StanceKey;\nexport declare function copyKey(from: StanceKey, out: StanceKey): StanceKey;"
        },
        {
          "file": "box-world.ts",
          "declarations": "import type { TraverseWorld } from './traverse-edge';\nexport type Box = {\n    x: number;\n    z: number;\n    y0: number;\n    y1: number;\n    halfX: number;\n    halfZ: number;\n    yaw?: number;\n    floor?: boolean;\n};\nexport type Water = {\n    x0: number;\n    z0: number;\n    x1: number;\n    z1: number;\n    level: number;\n};\nexport declare const PERSON: {\n    radius: number;\n    height: number;\n    step: number;\n};\nexport type BoxWorld = TraverseWorld & {\n    boxes: Box[];\n    water: Water[];\n    height(x: number, z: number, nearY: number, reach?: number): number;\n};\nexport declare function boxWorld(boxes?: Box[], water?: Water[], ground?: number, covered?: (x: number, z: number, feet: number) => boolean): BoxWorld;"
        },
        {
          "file": "skeleton.ts",
          "declarations": "import { type StanceBody, type StanceKey } from './body-frame';\nimport type { Vec3 } from './math';\nexport declare const JOINTS: readonly [\n    \"Hips\",\n    \"Spine\",\n    \"Chest\",\n    \"Neck\",\n    \"Head\",\n    \"UpperArmL\",\n    \"LowerArmL\",\n    \"HandL\",\n    \"UpperArmR\",\n    \"LowerArmR\",\n    \"HandR\",\n    \"UpperLegL\",\n    \"LowerLegL\",\n    \"FootL\",\n    \"BallL\",\n    \"UpperLegR\",\n    \"LowerLegR\",\n    \"FootR\",\n    \"BallR\"\n];\nexport type JointName = (typeof JOINTS)[number];\nexport declare const PARENTS: Int16Array<ArrayBuffer>;\nexport declare const J: Record<JointName, number>;\nexport declare const JOINT_COUNT: 19;\nexport type Root = {\n    x: number;\n    y: number;\n    z: number;\n    facing: number;\n};\nexport declare function twoBone(a: Vec3, target: Vec3, l1: number, l2: number, pole: Vec3, mid: Vec3, end: Vec3): boolean;\nexport declare function solveJoints(body: StanceBody, scale: number, root: Root, key: StanceKey, out: Float64Array): Float64Array<ArrayBufferLike>;\nexport declare function toWorld(model: readonly Vec3[], scale: number, root: Root, out: Float64Array): Float64Array<ArrayBufferLike>;\nexport declare function toModel(x: number, y: number, z: number, scale: number, root: Root, out: Vec3): Vec3;\nexport declare function boneLengths(positions: Float64Array): Float64Array<ArrayBuffer>;\nexport declare function keepLengths(positions: Float64Array, lengths: Float64Array): Float64Array<ArrayBufferLike>;\nexport declare const BONES: ReadonlyArray<readonly [\n    JointName,\n    JointName,\n    number\n]>;\nexport declare const HEAD_RADIUS = 0.11;\nexport declare function hitBody(positions: Float64Array, ox: number, oy: number, oz: number, dx: number, dy: number, dz: number, size?: number): {\n    t: number;\n    joint: number;\n    x: number;\n    y: number;\n    z: number;\n} | null;"
        },
        {
          "file": "three-mannequin.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nexport type MannequinLook = {\n    limb: THREE.ColorRepresentation;\n    joint: THREE.ColorRepresentation;\n    roughness?: number;\n};\nexport declare class MannequinView {\n    readonly group: THREE.Group<THREE.Object3DEventMap>;\n    readonly limbMaterial: THREE.MeshStandardNodeMaterial;\n    readonly jointMaterial: THREE.MeshStandardNodeMaterial;\n    constructor(look: MannequinLook, size?: number);\n    update(joints: ArrayLike<number>): void;\n    setLook(look: MannequinLook): void;\n    dispose(): void;\n}\nexport declare const MANNEQUIN_JOINTS: 19;"
        },
        {
          "file": "traverse-edge.ts",
          "declarations": "import type { TraversePlan } from './traverse';\nexport declare const SWIM_EXIT_REACH = 1.3;\nexport type TraverseWorld = {\n    surfaceAt: (x: number, z: number, from: number, step?: number) => number;\n    blockedAt: (x: number, z: number, feet: number) => boolean;\n    solidAt: (x: number, y: number, z: number, radius: number) => boolean;\n    coveredAt?: (x: number, z: number, feet: number) => boolean;\n    waterAt?: (x: number, z: number) => number | null;\n};\nexport declare const TRAVERSE: {\n    readonly step: 0.35;\n    readonly vault: 1;\n    readonly mantle: 1.7;\n    readonly thin: 0.6;\n    readonly stand: 0.45;\n    readonly ahead: 0.85;\n    readonly square: 0.7;\n    readonly wade: 0.3;\n    readonly onTop: 0.4;\n    readonly vaultOut: 0.75;\n    readonly drop: 1.6;\n};\ntype Point = {\n    x: number;\n    y: number;\n    z: number;\n};\nexport declare function planTraverse(world: TraverseWorld, feet: Point, dx: number, dz: number, facing: number, surface?: number): TraversePlan | null;\nexport {};"
        },
        {
          "file": "traverse.ts",
          "declarations": "import { type StanceBody, type StanceKey } from './body-frame';\nimport { type Vec3 } from './math';\nexport type TraverseKind = 'vault' | 'stepUp' | 'mantle' | 'ladder';\nexport type TraversePlan = {\n    kind: TraverseKind;\n    water: boolean;\n    from: Vec3;\n    startFacing: number;\n    facing: number;\n    edge: Vec3;\n    depth: number;\n    land: Vec3;\n    surface?: number;\n    ladder?: {\n        rungs: Array<[\n            number,\n            number\n        ]>;\n        across: number;\n    };\n};\nexport declare const TRAVERSE_TIMING: {\n    water: number;\n    tempo: number;\n    blendIn: number;\n    blendOut: number;\n};\ntype Frame = {\n    body: StanceBody;\n    scale: number;\n    hipsY: number;\n    ankleY: number;\n    footW: number;\n    toeOut: number;\n    thigh: number;\n    shin: number;\n    arm: number;\n};\ntype Pt = [\n    number,\n    number,\n    number\n];\nexport declare function shoulderIn(F: Frame, hips: Pt, pelvis: Pt, spine: Pt, side: 0 | 1): Pt;\nexport declare function hipIn(F: Frame, hips: Pt, pelvis: Pt, side: 0 | 1): Pt;\nexport type TraverseRoot = {\n    x: number;\n    y: number;\n    z: number;\n    facing: number;\n};\nexport declare class TraverseMotion {\n    readonly plan: TraversePlan;\n    readonly duration: number;\n    readonly holding: boolean;\n    readonly exitSpeed: number;\n    constructor(plan: TraversePlan, body?: StanceBody, scale?: number, holding?: boolean, flow?: number);\n    get keyTimes(): readonly number[];\n    rootAt(time: number, out: TraverseRoot): TraverseRoot;\n    keyAt(time: number, out: StanceKey): StanceKey;\n    contact(kind: 'hand' | 'foot', side: 0 | 1, time: number, out: Vec3): number;\n    reach(time: number): number[];\n}\nexport declare function traverseDuration(plan: TraversePlan): number;\nexport {};"
        },
        {
          "file": "traverser.ts",
          "declarations": "import { type StanceBody } from './body-frame';\nimport { type Root } from './skeleton';\nimport { TraverseMotion, type TraversePlan } from './traverse';\nimport { type TraverseWorld } from './traverse-edge';\nimport { Walker, type WalkStyle } from './walker';\nexport type TraverserWorld = TraverseWorld & {\n    height(x: number, z: number, nearY: number, reach?: number): number | null;\n};\nexport type TraverserOptions = {\n    world: TraverserWorld;\n    x?: number;\n    z?: number;\n    facing?: number;\n    body?: StanceBody;\n    scale?: number;\n    style?: WalkStyle;\n};\nexport type TraverserState = 'walking' | 'blocked' | 'moving';\nexport declare class Traverser {\n    readonly root: Root;\n    readonly walker: Walker;\n    speed: number;\n    heading: number;\n    state: TraverserState;\n    move: TraverseMotion | null;\n    moveClock: number;\n    plan: TraversePlan | null;\n    readonly positions: Float64Array<ArrayBuffer>;\n    readonly previous: Float64Array<ArrayBuffer>;\n    onMove: ((plan: TraversePlan, move: TraverseMotion) => void) | null;\n    readonly body: StanceBody;\n    readonly scale: number;\n    constructor(options: TraverserOptions);\n    reset(x: number, z: number, facing?: number): void;\n    tick(dt?: number): void;\n    sample(alpha: number, out: Float64Array): Float64Array<ArrayBufferLike>;\n    scrub(time: number): void;\n    get moving(): boolean;\n}"
        }
      ],
      "pitfalls": [
        "Ask the edge finder on intent, not every frame",
        "A box is not a floor",
        "The moves are authored for the reference body’s proportions (drawn at 0.89 m a unit)",
        "TRAVERSE_TIMING is one shared object",
        "The root is held along the move (rootAt) and the walk is not stepped meanwhile",
        "Lay the move over the walk with its weight",
        "From afloat (surface set on the plan), the reach is measured from the water’s surface",
        "The walk moves each foot along its line onto one tread",
        "On stairs the walk takes one tread a step and the Traverser holds the pace to Walker.stairPace",
        "The hips stand over the planted feet, not the root’s y",
        "Everything runs on a fixed 1/60 s tick",
        "Nothing here moves a skinned mesh",
        "The mannequin is drawn from joints, not skinned",
        "After a move the walk takes the feet where the move left them"
      ],
      "card": "entries/traversal.json"
    },
    {
      "id": "tree-view",
      "aliases": [],
      "name": "Tree view",
      "summary": "A virtualised tree for files, folders, outlines and categories: 50,000 nodes scroll smoothly with only the rows in view in the DOM, and opening a folder changes only the rows under it. Single, multiple or tri-state checkbox selection; lazy children with a loading row and an error row that retries; type-ahead, * to open a level, Home, End and Page keys; a filter that highlights matches and opens the way to each; F2 to rename; drag and drop before, into or after a node, with a drop line, opening on hover and edge scrolling, plus Alt+arrows and cut and paste for the keyboard. The WAI-ARIA tree pattern with a roving tabindex and every level and position given. Plain DOM, a base stylesheet and a plain look you can replace.",
      "category": "ui",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "tree view",
        "treeview",
        "file browser",
        "outline",
        "virtualised",
        "virtual scrolling",
        "lazy loading",
        "filter",
        "drag and drop",
        "checkboxes",
        "tri-state",
        "rename",
        "roving tabindex",
        "aria-level",
        "keyboard",
        "touch",
        "rtl",
        "accessibility",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "file and folder browsers",
        "project and document outlines",
        "category and tag pickers with checkboxes",
        "settings and navigation trees",
        "org charts and nested lists people rearrange",
        "large hierarchies loaded from a server level by level"
      ],
      "interaction": "Click or Tab into the tree · arrows, Enter, type to jump, F2 renames · drag rows (long-press on touch) or Alt+arrows to move",
      "kits": [
        {
          "kit": "foundations",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "split-panes",
          "why": "The tree in a side pane"
        },
        {
          "id": "drag-reorder",
          "why": "Reorder siblings by hand"
        },
        {
          "id": "command-palette",
          "why": "Jump to any node by name"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": null,
          "cpuMs": 0.435,
          "cpuP95Ms": 2.44,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured on the 50,000-item archive, three collections open: the tree scrolls 41 px every frame and redraws every row in view from scratch (a real scroll redraws only the rows that come in), opens or closes a folder every 24 frames and runs a filter over all 50,025 names every 150 frames, clearing it 40 frames later. At rest it does nothing."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.76,
          "cpuP95Ms": 1.1,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 101 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.78,
          "cpuP95Ms": 1.98,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 105 ms."
        }
      ],
      "signatures": [
        {
          "file": "tree-view.ts",
          "declarations": "import { type Range, type TreeNode } from './tree-model';\nexport type { Range, TreeNode } from './tree-model';\nexport { matchLabel, TreeModel } from './tree-model';\nexport type SelectionMode = 'none' | 'single' | 'multiple';\nexport type RowState = {\n    depth: number;\n    expanded: boolean | null;\n    selected: boolean;\n    checked: boolean | 'mixed' | null;\n    match: Range[] | null;\n    loading: boolean;\n    active: boolean;\n    cut: boolean;\n};\nexport type TreeMessages = {\n    loading: string;\n    loadFailed: (label: string) => string;\n    retry: string;\n    empty: string;\n    noMatches: (query: string) => string;\n    matches: (count: number) => string;\n    loaded: (label: string, count: number) => string;\n    items: (count: number) => string;\n    moved: (what: string, into: string | null, pos: number, size: number) => string;\n    cantMove: string;\n    cut: (what: string) => string;\n    cutCleared: string;\n    renamed: (label: string) => string;\n    renameLabel: (label: string) => string;\n    renameEmpty: string;\n    selected: (count: number) => string;\n    checkedAll: (label: string, on: boolean) => string;\n};\nexport type MoveRequest = {\n    ids: string[];\n    parent: string | null;\n    index: number;\n};\nexport type TreeViewOptions<T = unknown> = {\n    nodes: TreeNode<T>[];\n    label?: string;\n    labelledBy?: string;\n    selection?: SelectionMode;\n    checkboxes?: boolean;\n    followFocus?: boolean;\n    selected?: string[];\n    checked?: string[];\n    loadChildren?: (node: TreeNode<T>, signal: AbortSignal) => Promise<TreeNode<T>[]>;\n    icon?: (node: TreeNode<T>, state: {\n        expanded: boolean;\n    }) => string | Node | null;\n    renderRow?: (row: HTMLElement, node: TreeNode<T>, state: RowState) => void;\n    animate?: (row: HTMLElement, phase: 'enter') => void | Promise<void>;\n    holds?: (node: TreeNode<T>) => boolean;\n    match?: (node: TreeNode<T>, query: string) => Range[] | null;\n    movable?: boolean;\n    canMove?: (nodes: TreeNode<T>[], parent: TreeNode<T> | null, index: number) => boolean;\n    editable?: boolean | ((node: TreeNode<T>) => boolean);\n    guides?: boolean;\n    rowHeight?: number;\n    overscan?: number;\n    onSelectionChange?: (ids: string[]) => void;\n    onCheckedChange?: (ids: string[]) => void;\n    onActivate?: (node: TreeNode<T>) => void;\n    onToggle?: (node: TreeNode<T>, expanded: boolean) => void;\n    onMove?: (move: MoveRequest) => boolean | void;\n    onRename?: (node: TreeNode<T>, label: string) => boolean | string | void | Promise<boolean | string | void>;\n    announce?: (text: string) => void;\n    messages?: Partial<TreeMessages>;\n};\nexport type TreeView<T = unknown> = {\n    readonly element: HTMLElement;\n    get(id: string): TreeNode<T> | undefined;\n    getNodes(): TreeNode<T>[];\n    setNodes(nodes: TreeNode<T>[]): void;\n    parentOf(id: string): string | null | undefined;\n    childrenOf(id: string | null): string[] | null;\n    expand(id: string): void;\n    collapse(id: string): void;\n    toggle(id: string): void;\n    expandAll(): void;\n    collapseAll(): void;\n    expandedIds(): string[];\n    select(ids: string | string[]): void;\n    selected(): string[];\n    check(ids: string | string[], on?: boolean): void;\n    checked(which?: 'all' | 'leaves' | 'top'): string[];\n    focus(id?: string): void;\n    focusedId(): string | null;\n    reveal(id: string): boolean;\n    setFilter(query: string): number;\n    move(ids: string[], parent: string | null, index: number): boolean;\n    rename(id: string, label: string): void;\n    startRename(id?: string): boolean;\n    add(parent: string | null, nodes: TreeNode<T>[], index?: number): boolean;\n    remove(ids: string | string[]): void;\n    retry(id: string): void;\n    setOptions(options: Partial<Pick<TreeViewOptions<T>, 'selection' | 'checkboxes' | 'movable' | 'editable' | 'followFocus' | 'guides'>>): void;\n    refresh(): void;\n    destroy(): void;\n};\nexport declare function createTreeView<T = unknown>(host: HTMLElement, options: TreeViewOptions<T>): TreeView<T>;"
        }
      ],
      "pitfalls": [
        "Give the host a height (a flex child, a grid row or a fixed size)",
        "Every row is the same height, measured once from the CSS (and again when the text size changes)",
        "Ids must be unique across the whole tree, and stable",
        "The filter searches loaded nodes only",
        "Nothing can be dropped or pasted into a node whose children are not loaded yet",
        "onMove and onRename run before the change",
        "Checkboxes replace selection (aria-checked, not aria-selected)",
        "Alt+Left and Alt+Right are the browser’s Back and Forward",
        "Very large trees: the scroll height is rows × row height"
      ],
      "card": "entries/tree-view.json"
    },
    {
      "id": "ui-sounds",
      "aliases": [],
      "name": "Synthesised UI sounds",
      "summary": "Twelve interface sounds made live with the Web Audio API, no audio files: tap, press and release, toggles, slider ticks, success, error, a notification chime, a whoosh, a servo and a clunk, in three materials. The rules come with it: audio starts on a real gesture, quiet by default, repeats throttled, silent while muted, hidden or turned off in the app.",
      "category": "ui",
      "role": "interaction",
      "stack": [
        "headless"
      ],
      "character": "balanced",
      "tags": [
        "web audio",
        "sound design",
        "feedback",
        "synthesis",
        "accessibility",
        "reduced motion",
        "dom",
        "no dependencies"
      ],
      "useCases": [
        "buttons, switches and sliders that feel physical",
        "save, success and error feedback",
        "notifications and chat",
        "games and playful tools",
        "kiosks and touch screens",
        "dashboards that need a quiet alert"
      ],
      "interaction": "Click once to start audio, then use the controls or the pads · the scope draws each sound, even when muted",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        },
        {
          "kit": "shop",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "micro-interactions",
          "why": "A sound for each small moment"
        },
        {
          "id": "effects-switchboard",
          "why": "A switch for all sound"
        },
        {
          "id": "audio-engine",
          "why": "Music and cues beside the interface sounds"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "muted",
          "in": "module",
          "values": {
            "strict": true,
            "refined": true,
            "playful": false
          },
          "note": "always behind the user’s own switch"
        },
        {
          "name": "volume",
          "in": "module",
          "values": {
            "playful": 0.7
          }
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.80",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-03",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.005,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured idle: the bench run has no user gesture, and headless Chrome as the bench launches it keeps an AudioContext suspended without one (checked), so no sound can play. The cost of a sound is a few short-lived Web Audio nodes; the mixing runs on the browser’s audio thread, outside the frame."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.005,
          "cpuP95Ms": 0.01,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 543 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 52 ms."
        }
      ],
      "signatures": [
        {
          "file": "ui-sounds.ts",
          "declarations": "export type SoundName = 'tap' | 'press' | 'release' | 'toggleOn' | 'toggleOff' | 'tick' | 'success' | 'error' | 'notify' | 'whoosh' | 'servo' | 'clunk';\nexport type Character = 'ceramic' | 'soft' | 'mechanical';\nexport type SoundState = 'waiting' | 'on' | 'muted' | 'off' | 'hidden' | 'unsupported';\nexport type PlayResult = 'played' | Exclude<SoundState, 'on'> | 'motion' | 'repeat' | 'busy';\nexport type PlayOptions = {\n    pitch?: number;\n    level?: number;\n};\nexport type UiSoundsOptions = {\n    volume?: number;\n    muted?: boolean;\n    enabled?: () => boolean;\n    character?: Character;\n    pitch?: number;\n    vary?: number;\n    gap?: number;\n    maxVoices?: number;\n    motionSounds?: 'auto' | 'on' | 'off';\n    target?: EventTarget;\n    onState?: (state: SoundState) => void;\n};\ntype Voice = {\n    ctx: BaseAudioContext;\n    out: AudioNode;\n    t: number;\n    noise: AudioBuffer;\n    pitch: number;\n    level: number;\n    character: Character;\n};\ntype Spec = {\n    play: (v: Voice) => void;\n    length: number;\n    motion?: boolean;\n};\nexport declare const SOUNDS: Record<SoundName, Spec>;\nexport declare const SOUND_NAMES: SoundName[];\nexport declare function createUiSounds(options?: UiSoundsOptions): {\n    play(name: SoundName, play?: PlayOptions): PlayResult;\n    render(name: SoundName, play?: PlayOptions, sampleRate?: number): Promise<AudioBuffer>;\n    unlock(): void;\n    readonly state: SoundState;\n    volume: number;\n    muted: boolean;\n    character: Character;\n    pitch: number;\n    options: {\n        volume: number;\n        muted: boolean;\n        enabled: () => boolean;\n        character: Character;\n        pitch: number;\n        vary: number;\n        gap: number;\n        maxVoices: number;\n        motionSounds: \"off\" | \"on\" | \"auto\";\n    };\n    refresh: () => void;\n    stop(): void;\n};\nexport type UiSounds = ReturnType<typeof createUiSounds>;\nexport {};"
        }
      ],
      "pitfalls": [
        "Browsers keep an AudioContext suspended until the page has had a click, a tap or a key press",
        "On touch, pointerdown does not count as a gesture",
        "UI sounds are an extra, never the only feedback",
        "Sounds should be opt-in in most apps",
        "Reduced motion does not mute the sounds",
        "Keep them short and quiet",
        "Each play builds a few Web Audio nodes",
        "stop() closes the AudioContext"
      ],
      "card": "entries/ui-sounds.json"
    },
    {
      "id": "units-math",
      "aliases": [],
      "name": "Units that carry through arithmetic, and goal seek",
      "summary": "Numbers that keep their units through every step: rates divide (84 km ÷ 22 km/h = 3.82 h), totals multiply (40 jars/h × 6 h = 240 jars), sums convert between scales (2 h + 30 min = 2.5 h) and refuse what makes no sense, in words (“Cannot add jars and kg”). Custom units are units too (jars, visitors), and you can define your own (crate = 12 jars); each currency is its own, and a working calendar gives shifts, working days and weeks. A small formula language and a sheet of named rows sit on top, and goal seek answers “what would this need to be?” by bracketing and the secant method, without touching the sheet. Pure TypeScript, tested.",
      "category": "data",
      "role": "system",
      "stack": [
        "headless"
      ],
      "character": "calm",
      "tags": [
        "units",
        "dimensions",
        "quantities",
        "conversion",
        "rates",
        "currency",
        "custom units",
        "formulas",
        "calculator",
        "spreadsheet",
        "goal seek",
        "secant method",
        "what-if",
        "plain-English errors",
        "pure",
        "tested",
        "no dependencies"
      ],
      "useCases": [
        "calculators and estimators where people type “120 jars/h” or “€3.20/kg”",
        "planning sheets: rates × time, cost per unit, totals per week",
        "catching unit mistakes before they become wrong numbers",
        "showing rates per hour, shift, working day or week",
        "answering “what price would make this profit?” (goal seek)",
        "formula fields in a no-code tool or a board app"
      ],
      "interaction": "Edit any value or formula · focus a row to see what it reads and what cancels · ask the goal seek on the right, then Apply",
      "kits": [
        {
          "kit": "dashboard",
          "as": "optional"
        },
        {
          "kit": "shop",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "property-panel",
          "why": "Fields that carry units"
        },
        {
          "id": "sheet-chart-suggest",
          "why": "Units read from the sheet’s headers"
        },
        {
          "id": "field-rules",
          "why": "Checks that totals add up"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-13",
          "gpuMs": null,
          "cpuMs": 1.575,
          "cpuP95Ms": 2.075,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the sheet editing itself: every frame it types a new rate into “jars per hour” (40, 41, … 49), so each frame reads the entry, works the whole sheet out again (13 rows, units carried through every step) and repaints the results, the unit fractions and the explanation. Nothing runs while nothing is typed."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 2.735,
          "cpuP95Ms": 3.59,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 67 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 4.42,
          "cpuP95Ms": 4.86,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 130 ms."
        }
      ],
      "signatures": [
        {
          "file": "goalseek.ts",
          "declarations": "export type SeekTry = {\n    input: number;\n    achieved: number | null;\n};\nexport type SeekResult = {\n    ok: true;\n    input: number;\n    achieved: number;\n    tries: number;\n    trace: SeekTry[];\n} | {\n    ok: false;\n    reason: 'no-target' | 'flat' | 'unreachable' | 'unstable';\n    message: string;\n    best?: {\n        input: number;\n        achieved: number;\n    };\n    trace: SeekTry[];\n};\nexport type SeekOptions = {\n    tolerance?: number;\n    maxTries?: number;\n    min?: number;\n    max?: number;\n    name?: string;\n    write?: (n: number, what: 'input' | 'result') => string;\n};\nexport declare function goalSeek(result: (x: number) => number | null, x0: number, goal: number, opts?: SeekOptions): SeekResult;"
        },
        {
          "file": "quantity.ts",
          "declarations": "import { type Calendar, type Unit, type UnitTable } from './units';\nexport type Qty = {\n    n: number;\n    u: Unit;\n};\nexport declare class UnitError extends Error {\n}\nexport declare const qty: (n: number, u?: Unit) => Qty;\nexport declare const shown: (q: Qty) => number;\nexport declare function add(a: Qty, b: Qty): Qty;\nexport declare function sub(a: Qty, b: Qty): Qty;\nexport declare const mul: (a: Qty, b: Qty) => Qty;\nexport declare function div(a: Qty, b: Qty): Qty;\nexport declare function pow(a: Qty, b: Qty): Qty;\nexport declare function compare(a: Qty, b: Qty): number;\nexport declare function convert(q: Qty, to: Unit): Qty;\nexport declare function valueIn(q: Qty, unit: Unit): number;\nexport declare function readNumber(s: string): number | null;\nexport declare function readQuantity(raw: string, own?: Unit, table?: UnitTable): {\n    q: Qty;\n    fits: true;\n} | {\n    unit: string;\n    fits: false;\n} | null;\nexport type TimeBase = 'h' | 'shift' | 'wd' | 'ww' | 'mo' | 'yr';\nexport type NumberFormat = {\n    decimal: '.' | ',';\n    group: ',' | '.' | ' ' | \"'\" | '';\n};\nexport type Display = {\n    base: TimeBase;\n    calendar: Calendar;\n    format: NumberFormat;\n};\nexport declare const DEFAULT_DISPLAY: Display;\nexport declare function formatNumber(n: number, display?: Display, decimals?: number): string;\nexport declare function inBase(q: Qty, display?: Display): Qty;\nexport declare function formatQty(q: Qty, display?: Display): string;\nexport declare const isMoney: (u: Unit) => boolean;"
        },
        {
          "file": "sheet.ts",
          "declarations": "import { type SeekResult } from './goalseek';\nimport { type Display, type Qty } from './quantity';\nimport { type Unit, type UnitTable } from './units';\nexport type SheetRow = {\n    name: string;\n    entry: string;\n};\nexport type CellResult = {\n    name: string;\n    key: string;\n    kind: 'input' | 'formula' | 'empty';\n    value: Qty | null;\n    error: string | null;\n    reads: string[];\n    step?: {\n        op: '+' | '-' | '*' | '/' | '^';\n        left: Qty;\n        right: Qty;\n        cancels: string[];\n    };\n};\nexport type SheetOptions = {\n    table?: UnitTable;\n};\nexport declare function compileSheet(rows: readonly SheetRow[], opts?: SheetOptions): {\n    rows: {\n        name: string;\n        key: string;\n        kind: \"input\" | \"empty\" | \"formula\";\n    }[];\n    run: (overrides?: Readonly<Record<string, Qty>>) => CellResult[];\n    table: Readonly<Record<string, import(\"./units\").KnownUnit>>;\n};\nexport declare const evaluateSheet: (rows: readonly SheetRow[], opts?: SheetOptions) => CellResult[];\nexport declare function dependentsOf(results: readonly CellResult[], key: string): Set<string>;\nexport type SheetSeek = SeekResult & {\n    unit: Unit;\n    targetUnit: Unit;\n    entry?: string;\n};\nexport declare function entryText(n: number, u: Unit): string;\nexport declare function seekSheet(rows: readonly SheetRow[], q: {\n    change: string;\n    target: string;\n    goal: Qty | string | number;\n    min?: number;\n    max?: number;\n    display?: Display;\n}, opts?: SheetOptions): SheetSeek;"
        },
        {
          "file": "units.ts",
          "declarations": "export type Dims = Readonly<Record<string, number>>;\nexport type Unit = {\n    dims: Dims;\n    scale: number;\n    label: string;\n};\nexport declare const NONE: Unit;\nexport type KnownUnit = {\n    dims: Dims;\n    scale: number;\n    label: string;\n};\nexport type UnitTable = Readonly<Record<string, KnownUnit>>;\nexport type Calendar = {\n    hoursPerShift: number;\n    shiftsPerDay: number;\n    daysPerWeek: number;\n};\nexport declare const DEFAULT_CALENDAR: Calendar;\nexport declare function calendarHours(c: Calendar): Record<'shift' | 'wd' | 'ww' | 'mo' | 'yr', number>;\nexport type UnitTableOptions = {\n    calendar?: Calendar;\n    kr?: 'SEK' | 'DKK' | 'NOK';\n    define?: Record<string, string>;\n};\nexport declare function unitTable(opts?: UnitTableOptions): UnitTable;\nexport declare const defaultUnits: () => UnitTable;\nexport declare const CURRENCIES: Record<string, string>;\nexport declare const isKnownUnit: (word: string, table?: UnitTable) => boolean;\nexport declare function parseUnit(text: string, table?: UnitTable): Unit;\nexport declare const sameDims: (a: Dims, b: Dims) => boolean;\nexport declare const isDimensionless: (u: Unit) => boolean;\nexport declare function unitFor(dims: Dims): Unit;\nexport declare function multiplyUnits(a: Unit, b: Unit, divide?: boolean): Unit;\nexport declare function powerUnit(a: Unit, p: number): Unit;\nexport declare const describeDims: (d: Dims) => string;\nexport declare function cancelled(a: Unit, b: Unit, divide?: boolean): string[];"
        }
      ],
      "pitfalls": [
        "A quantity is stored in base units (2 h is 7200, written “h”)",
        "Any word that is not a known unit becomes a dimension of its own (“jars”, “bottles”)",
        "Plurals are folded only by a trailing s",
        "Each currency is its own dimension",
        "In a formula, only known units follow a number (“30 min”, “1 shift”)",
        "Labels are kept as written",
        "The calendar (shift, wd, ww, mo, yr) lives in the unit table",
        "Goal seek works out the whole sheet once a try (up to 80)",
        "Messages quote what people typed",
        "Typing always reads a point as the decimal mark (“1,500” is fifteen hundred)",
        "compare (and so min, max and the step check of round) counts two quantities as equal when they…",
        "round, ceil and floor snap to 12 significant figures before rounding"
      ],
      "card": "entries/units-math.json"
    },
    {
      "id": "vehicle-models",
      "aliases": [],
      "name": "Small vehicle models: helicopter, airboat, springs and a grapple line",
      "summary": "Four small, pure models of how things move, each stepped with plain ground functions and no physics engine: a helicopter with a spooling rotor, a collective that holds its height, a cyclic that leans into its motion, a flare that lands it gently and rotor strikes; an airboat whose hull floats or rests on four corners, pushed by a fan and steered by air rudders that need wind on them, fast on water and mud, crawling on dry ground; a sprung body on two or three axles that pitches, rolls, droops its wheels and scrapes its belly, carried by a small arcade car; and a grapple pendulum that winds in, swings, pumps, reels and lets go. Tuning knobs come with ranges, hints and a checker.",
      "category": "simulation",
      "role": "system",
      "stack": [
        "headless"
      ],
      "character": "balanced",
      "tags": [
        "vehicle",
        "helicopter",
        "airboat",
        "boat",
        "buoyancy",
        "suspension",
        "springs",
        "car",
        "arcade physics",
        "pendulum",
        "grapple",
        "rope swing",
        "fixed step",
        "pure",
        "server-safe",
        "no dependencies",
        "touch",
        "virtual stick"
      ],
      "useCases": [
        "a flyable helicopter in an open world",
        "boats on lakes, rivers and marsh",
        "cars whose bodies pitch and roll on their springs",
        "a swinging grapple or rope",
        "vehicles stepped on a server or in tests",
        "tuning panels for vehicle feel"
      ],
      "interaction": "1 to 4 pick a model · W A S D drive · Space and Shift lift or brake · Q E turn or reel · drag to look round · R puts it back",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "heightfield-chunks",
          "why": "The ground they step over"
        },
        {
          "id": "game-cameras",
          "why": "Cameras that follow them"
        },
        {
          "id": "water-ripples",
          "why": "Wakes behind the airboat"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-13",
          "gpuMs": 0.492,
          "cpuMs": 0.563,
          "cpuP95Ms": 0.785,
          "badge": "moderate",
          "drawCalls": 58,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured flying the helicopter by itself: it spools up, climbs to about 8 m and flies a wide left circle past the posts. The airboat, the car and the figure are stepped too, parked (they cost almost nothing at rest). Standing still with every rotor stopped, nothing is drawn."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 3.113,
          "cpuMs": 1.195,
          "cpuP95Ms": 1.7,
          "badge": "heavy",
          "drawCalls": 59,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 402 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 2.073,
          "cpuMs": 0.16,
          "cpuP95Ms": 0.26,
          "badge": "heavy",
          "drawCalls": 58,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 303 ms."
        }
      ],
      "signatures": [
        {
          "file": "airboat.ts",
          "declarations": "import { VehicleSuspension } from './suspension';\nimport type { SolidAt, Surface, VehicleControls, VehicleImpact } from './types';\nexport interface AirboatGround {\n    height(x: number, z: number): number;\n    surface?(x: number, z: number): Surface;\n    water?(x: number, z: number): number | null;\n    wet?(x: number, z: number): boolean;\n    solid?: SolidAt;\n}\nexport declare const AIRBOAT_FIELDS: {\n    readonly topSpeedKmh: {\n        readonly label: \"Top speed on water\";\n        readonly hint: \"Flat out on open water for a boat with 5 N of thrust per kilo. Stronger engines and lighter boats run faster, heavier ones slower.\";\n        readonly min: 20;\n        readonly max: 120;\n        readonly step: 1;\n        readonly value: 65;\n        readonly unit: \" km/h\";\n        readonly group: \"Water\";\n    };\n    readonly planingKmh: {\n        readonly label: \"Planing speed\";\n        readonly hint: \"Below it the hull pushes water: extra drag and the bow up under throttle. Above it the hull planes on its flat bottom.\";\n        readonly min: 5;\n        readonly max: 50;\n        readonly step: 1;\n        readonly value: 22;\n        readonly unit: \" km/h\";\n        readonly group: \"Water\";\n    };\n    readonly plowDrag: {\n        readonly label: \"Plowing drag\";\n        readonly hint: \"Extra drag while the hull pushes water, fading out at planing speed. It also lets a drifting boat come to rest.\";\n        readonly min: 0;\n        readonly max: 2;\n        readonly step: 0.05;\n        readonly value: 0.6;\n        readonly unit: \" /s\";\n        readonly group: \"Water\";\n    };\n    readonly sideDrag: {\n        readonly label: \"Sideways water grip\";\n        readonly hint: \"How hard the water resists the hull sliding sideways. Lower slides further out in turns; higher carves like a keel boat.\";\n        readonly min: 0.2;\n        readonly max: 5;\n        readonly step: 0.05;\n        readonly value: 1.4;\n        readonly unit: \" /s\";\n        readonly group: \"Water\";\n    };\n    readonly draft: {\n        readonly label: \"Draft\";\n        readonly hint: \"How deep the loaded hull sits in still water. Deeper bobs slower and needs deeper water to float clear of the bed.\";\n        readonly min: 0.05;\n        readonly max: 0.4;\n        readonly step: 0.01;\n        readonly value: 0.12;\n        readonly unit: \" m\";\n        readonly group: \"Water\";\n    };\n    readonly waveBob: {\n        readonly label: \"Swell\";\n        readonly hint: \"Height of the small waves it rides on open water (not in puddles). 0 for glassy water.\";\n        readonly min: 0;\n        readonly max: 0.2;\n        readonly step: 0.005;\n        readonly value: 0.04;\n        readonly unit: \" m\";\n        readonly group: \"Water\";\n    };\n    readonly turnRateDeg: {\n        readonly label: \"Turn rate\";\n        readonly hint: \"How fast it swings at full rudder once the rudders have air on them: the fan at full, or speed alone above the rudder-bite speed.\";\n        readonly min: 20;\n        readonly max: 180;\n        readonly step: 1;\n        readonly value: 60;\n        readonly unit: \" °/s\";\n        readonly group: \"Steering\";\n    };\n    readonly turnResponse: {\n        readonly label: \"Turn response\";\n        readonly hint: \"How quickly the swing builds and stops. Low feels heavy and drifty, high twitchy.\";\n        readonly min: 0.5;\n        readonly max: 8;\n        readonly step: 0.1;\n        readonly value: 2.5;\n        readonly unit: \" /s\";\n        readonly group: \"Steering\";\n    };\n    readonly steerKmh: {\n        readonly label: \"Rudder bite speed\";\n        readonly hint: \"Speed at which the wind of its own motion steers fully without the fan. Stopped with the fan idle, the rudders do nothing.\";\n        readonly min: 5;\n        readonly max: 80;\n        readonly step: 1;\n        readonly value: 30;\n        readonly unit: \" km/h\";\n        readonly group: \"Steering\";\n    };\n    readonly spool: {\n        readonly label: \"Fan spool\";\n        readonly hint: \"How quickly the engine and fan come up to the throttle and back down.\";\n        readonly min: 0.3;\n        readonly max: 8;\n        readonly step: 0.1;\n        readonly value: 2.2;\n        readonly unit: \" /s\";\n        readonly group: \"Fan\";\n    };\n    readonly reverse: {\n        readonly label: \"Reverse thrust\";\n        readonly hint: \"Backing up as a share of forward thrust (a pitch-reversing prop is weak). Reverse also turns the rudders around.\";\n        readonly min: 0;\n        readonly max: 0.6;\n        readonly step: 0.01;\n        readonly value: 0.3;\n        readonly unit: \"×\";\n        readonly group: \"Fan\";\n    };\n    readonly brakeDrag: {\n        readonly label: \"Hull dig\";\n        readonly hint: \"The brake cuts the fan and digs the hull in: the slowing it adds on water or ground. Airboats have no brakes; this is the arcade stop.\";\n        readonly min: 0;\n        readonly max: 8;\n        readonly step: 0.1;\n        readonly value: 3;\n        readonly unit: \" m/s²\";\n        readonly group: \"Fan\";\n    };\n    readonly wetFriction: {\n        readonly label: \"Mud and shallows friction\";\n        readonly hint: \"Friction on mud, wetland and water too shallow to float in. Airboats skim these nearly as fast as water.\";\n        readonly min: 0.01;\n        readonly max: 0.5;\n        readonly step: 0.01;\n        readonly value: 0.06;\n        readonly unit: \"\";\n        readonly group: \"Ground\";\n    };\n    readonly grassFriction: {\n        readonly label: \"Grass friction\";\n        readonly hint: \"Friction on grass. Wet prairie runs fast; raise it for dry lawns.\";\n        readonly min: 0.01;\n        readonly max: 0.6;\n        readonly step: 0.01;\n        readonly value: 0.14;\n        readonly unit: \"\";\n        readonly group: \"Ground\";\n    };\n    readonly dryFriction: {\n        readonly label: \"Dry ground friction\";\n        readonly hint: \"Friction on dry dirt, sand, gravel and rock: at 0.45 it crawls at walking pace at full fan, so it is never stuck and never fast there.\";\n        readonly min: 0.05;\n        readonly max: 0.8;\n        readonly step: 0.01;\n        readonly value: 0.45;\n        readonly unit: \"\";\n        readonly group: \"Ground\";\n    };\n    readonly pavedFriction: {\n        readonly label: \"Pavement friction\";\n        readonly hint: \"Friction on asphalt, concrete and roads: at 0.46 a crawl at walking pace at full fan.\";\n        readonly min: 0.05;\n        readonly max: 0.9;\n        readonly step: 0.01;\n        readonly value: 0.46;\n        readonly unit: \"\";\n        readonly group: \"Ground\";\n    };\n    readonly snowFriction: {\n        readonly label: \"Snow and ice friction\";\n        readonly hint: \"Friction on snow and ice, where airboats run well.\";\n        readonly min: 0.01;\n        readonly max: 0.5;\n        readonly step: 0.01;\n        readonly value: 0.05;\n        readonly unit: \"\";\n        readonly group: \"Ground\";\n    };\n    readonly groundDrag: {\n        readonly label: \"Grinding drag\";\n        readonly hint: \"Drag on ground that grows with speed: what sets its top speed on mud and grass.\";\n        readonly min: 0;\n        readonly max: 2;\n        readonly step: 0.05;\n        readonly value: 0.25;\n        readonly unit: \" /s\";\n        readonly group: \"Ground\";\n    };\n    readonly sideGrip: {\n        readonly label: \"Sideways ground grip\";\n        readonly hint: \"How much more the hull resists sliding sideways on ground than straight on.\";\n        readonly min: 1;\n        readonly max: 4;\n        readonly step: 0.05;\n        readonly value: 1.6;\n        readonly unit: \"×\";\n        readonly group: \"Ground\";\n    };\n    readonly maxClimbDeg: {\n        readonly label: \"Steepest bank\";\n        readonly hint: \"Banks and slopes steeper than this stop it like a wall where they rise above the hull. Gentler banks it drives up while the fan can push it.\";\n        readonly min: 5;\n        readonly max: 45;\n        readonly step: 1;\n        readonly value: 24;\n        readonly unit: \"°\";\n        readonly group: \"Ground\";\n    };\n};\nexport type AirboatField = keyof typeof AIRBOAT_FIELDS;\nexport type AirboatConfig = Record<AirboatField, number>;\nexport declare function defaultAirboat(): AirboatConfig;\nexport declare function readAirboat(value: unknown): AirboatConfig | undefined;\nexport declare function airboatIssues(value: unknown): string[];\nexport declare const RUDDER_ANGLE = 0.45;\nexport declare function airboatFriction(config: AirboatConfig, surface: Surface, wet: boolean): number;\nexport type AirboatOptions = {\n    x?: number;\n    z?: number;\n    heading?: number;\n    config?: AirboatConfig;\n    mass?: number;\n    thrust?: number;\n    length?: number;\n    width?: number;\n};\nexport declare class Airboat {\n    x: number;\n    y: number;\n    z: number;\n    vx: number;\n    vz: number;\n    heading: number;\n    yawRate: number;\n    config: AirboatConfig;\n    mass: number;\n    thrustPerKg: number;\n    readonly length: number;\n    readonly width: number;\n    readonly hull: VehicleSuspension;\n    fan: number;\n    rudder: number;\n    time: number;\n    afloat: number;\n    aground: number;\n    friction: number;\n    slopeForward: number;\n    slopeSide: number;\n    wall: boolean;\n    walled: number;\n    surface: Surface;\n    wet: boolean;\n    thrust: number;\n    forward: number;\n    acceleration: number;\n    grounded: boolean;\n    blocked: boolean;\n    readonly impacts: VehicleImpact[];\n    readonly water: Float64Array<ArrayBuffer>;\n    readonly ground: Float64Array<ArrayBuffer>;\n    readonly floating: Uint8Array<ArrayBuffer>;\n    constructor(options?: AirboatOptions);\n    place(x: number, z: number, heading?: number, y?: number): void;\n    get isAfloat(): boolean;\n    step(controls: VehicleControls, ground: AirboatGround, dt: number): void;\n    drive(controls: VehicleControls, ground: AirboatGround, surface: Surface, forward: number, lateral: number, dt: number): {\n        forwardSpeed: number;\n        lateralSpeed: number;\n        yawRate: number;\n        lateralAcceleration: number;\n    };\n    floatHull(ground: AirboatGround, acceleration: number, lateralAcceleration: number, dt: number): void;\n}\nexport declare function airboatReadout(boat: Airboat): string;\nexport interface AirboatSpray {\n    kind: 'water' | 'ground';\n    position: [\n        number,\n        number,\n        number\n    ];\n    direction: [\n        number,\n        number,\n        number\n    ];\n    speed: number;\n    intensity: number;\n}\nexport declare function airboatSpray(boat: Airboat, ground: AirboatGround): AirboatSpray[];"
        },
        {
          "file": "grapple.ts",
          "declarations": "export type Point = {\n    x: number;\n    y: number;\n    z: number;\n};\nexport type SwingWorld = {\n    surfaceAt: (x: number, z: number, from: number, step?: number) => number;\n    blockedAt?: (x: number, z: number, feet: number) => boolean;\n};\nexport declare const SWING: {\n    grip: number;\n    gravity: number;\n    pump: number;\n    steer: number;\n    drag: number;\n    shortest: number;\n    clear: number;\n    rise: number;\n    notch: number;\n    reel: number;\n    airborne: number;\n    fastest: number;\n    scrub: number;\n    stuck: number;\n};\nexport type SwingTuning = typeof SWING;\nexport type SwingPlan = {\n    anchor: Point;\n    length: number;\n    target: number;\n};\nexport declare function planSwing(world: SwingWorld, anchor: Point, feet: Point, range: number, tuning?: SwingTuning): SwingPlan | null;\nexport type SwingPhase = 'line' | 'free' | 'landed';\nexport declare class GrappleSwing {\n    phase: SwingPhase;\n    readonly position: Point;\n    readonly velocity: Point;\n    anchor: Point;\n    length: number;\n    readonly tuning: SwingTuning;\n    facing: number;\n    grounded: boolean;\n    constructor(plan: SwingPlan, feet: Point, velocity: {\n        x: number;\n        z: number;\n    }, facing: number, range: number, winch: number, tuning?: SwingTuning);\n    get onLine(): boolean;\n    get hands(): Point;\n    get low(): number;\n    reel(notches: number): void;\n    letGo(): void;\n    attach(plan: SwingPlan): void;\n    step(dt: number, push: {\n        x: number;\n        z: number;\n    }, world: SwingWorld): Point | null;\n}"
        },
        {
          "file": "helicopter.ts",
          "declarations": "import { type VehicleControls, type VehicleImpact } from './types';\nexport declare const HELI_FIELDS: {\n    readonly topSpeed: {\n        readonly label: \"Top speed\";\n        readonly hint: \"The most it flies, forward, m/s. Low flight keeps it a little under a car on a road, so it reads as nimble, not fast.\";\n        readonly min: 8;\n        readonly max: 30;\n        readonly step: 0.5;\n        readonly value: 13;\n        readonly unit: \" m/s\";\n        readonly group: \"Flight\";\n    };\n    readonly sideSpeed: {\n        readonly label: \"Sideways speed\";\n        readonly hint: \"How fast steering slides it sideways at a hover. At speed the tail swings the nose round instead (Weathervane).\";\n        readonly min: 3;\n        readonly max: 15;\n        readonly step: 0.5;\n        readonly value: 6;\n        readonly unit: \" m/s\";\n        readonly group: \"Flight\";\n    };\n    readonly backSpeed: {\n        readonly label: \"Backwards speed\";\n        readonly hint: \"How fast it backs up.\";\n        readonly min: 2;\n        readonly max: 12;\n        readonly step: 0.5;\n        readonly value: 4.5;\n        readonly unit: \" m/s\";\n        readonly group: \"Flight\";\n    };\n    readonly cyclicAccel: {\n        readonly label: \"Cyclic authority\";\n        readonly hint: \"The hardest it speeds up or slows down, m/s². Lower is heavier and calmer; higher darts about.\";\n        readonly min: 1;\n        readonly max: 10;\n        readonly step: 0.1;\n        readonly value: 4.5;\n        readonly unit: \" m/s²\";\n        readonly group: \"Flight\";\n    };\n    readonly cyclicResponse: {\n        readonly label: \"Cyclic response\";\n        readonly hint: \"How quickly it closes on the speed the stick asks for, once the authority allows.\";\n        readonly min: 0.3;\n        readonly max: 4;\n        readonly step: 0.05;\n        readonly value: 1.1;\n        readonly unit: \" /s\";\n        readonly group: \"Flight\";\n    };\n    readonly hoverHold: {\n        readonly label: \"Hover hold\";\n        readonly hint: \"How quickly it brakes to a hover when the stick is let go. Higher stops shorter and feels more precise.\";\n        readonly min: 0.3;\n        readonly max: 4;\n        readonly step: 0.05;\n        readonly value: 1.4;\n        readonly unit: \" /s\";\n        readonly group: \"Flight\";\n    };\n    readonly maxTiltDeg: {\n        readonly label: \"Most tilt\";\n        readonly hint: \"The steepest it leans into its motion. Drawn only: the speed comes from the stick, not the lean.\";\n        readonly min: 4;\n        readonly max: 30;\n        readonly step: 1;\n        readonly value: 16;\n        readonly unit: \"°\";\n        readonly group: \"Flight\";\n    };\n    readonly yawRateDeg: {\n        readonly label: \"Turn rate\";\n        readonly hint: \"How fast the pedals turn it on the spot.\";\n        readonly min: 20;\n        readonly max: 180;\n        readonly step: 1;\n        readonly value: 75;\n        readonly unit: \" °/s\";\n        readonly group: \"Flight\";\n    };\n    readonly yawResponse: {\n        readonly label: \"Turn response\";\n        readonly hint: \"How quickly a turn builds and stops.\";\n        readonly min: 1;\n        readonly max: 10;\n        readonly step: 0.1;\n        readonly value: 4;\n        readonly unit: \" /s\";\n        readonly group: \"Flight\";\n    };\n    readonly weathervane: {\n        readonly label: \"Weathervane\";\n        readonly hint: \"How hard the tail fin swings the nose into the way it travels at speed (none below 3 m/s). 0 keeps the nose where the pedals put it.\";\n        readonly min: 0;\n        readonly max: 3;\n        readonly step: 0.05;\n        readonly value: 0.9;\n        readonly unit: \" /s\";\n        readonly group: \"Flight\";\n    };\n    readonly climbRate: {\n        readonly label: \"Climb rate\";\n        readonly hint: \"How fast full collective takes it up.\";\n        readonly min: 2;\n        readonly max: 12;\n        readonly step: 0.5;\n        readonly value: 3.5;\n        readonly unit: \" m/s\";\n        readonly group: \"Lift\";\n    };\n    readonly descentRate: {\n        readonly label: \"Descent rate\";\n        readonly hint: \"How fast it comes down, until the flare near the ground.\";\n        readonly min: 2;\n        readonly max: 10;\n        readonly step: 0.5;\n        readonly value: 5;\n        readonly unit: \" m/s\";\n        readonly group: \"Lift\";\n    };\n    readonly liftResponse: {\n        readonly label: \"Collective response\";\n        readonly hint: \"How quickly the climb or descent follows the stick, and stops when it is let go.\";\n        readonly min: 0.5;\n        readonly max: 6;\n        readonly step: 0.1;\n        readonly value: 2.2;\n        readonly unit: \" /s\";\n        readonly group: \"Lift\";\n    };\n    readonly ceiling: {\n        readonly label: \"Flight ceiling\";\n        readonly hint: \"The highest it climbs over the ground or roof below, m.\";\n        readonly min: 10;\n        readonly max: 120;\n        readonly step: 1;\n        readonly value: 25;\n        readonly unit: \" m\";\n        readonly group: \"Lift\";\n    };\n    readonly flareHeight: {\n        readonly label: \"Flare height\";\n        readonly hint: \"Below this height a descent slows toward the touchdown speed, so holding it down lands it gently.\";\n        readonly min: 1;\n        readonly max: 12;\n        readonly step: 0.5;\n        readonly value: 5;\n        readonly unit: \" m\";\n        readonly group: \"Landing\";\n    };\n    readonly touchdownSpeed: {\n        readonly label: \"Touchdown speed\";\n        readonly hint: \"How fast a held descent meets the ground at the end of the flare. Keep it under the hard landing.\";\n        readonly min: 0.3;\n        readonly max: 3;\n        readonly step: 0.1;\n        readonly value: 1.2;\n        readonly unit: \" m/s\";\n        readonly group: \"Landing\";\n    };\n    readonly hardLanding: {\n        readonly label: \"Hard landing\";\n        readonly hint: \"Meeting the ground faster than this, straight down, hurts the airframe.\";\n        readonly min: 1.5;\n        readonly max: 8;\n        readonly step: 0.1;\n        readonly value: 3.5;\n        readonly unit: \" m/s\";\n        readonly group: \"Landing\";\n    };\n    readonly skidSpeed: {\n        readonly label: \"Skid touchdown speed\";\n        readonly hint: \"Touching down (or flying into rising ground) faster than this sideways or forward hurts the airframe too.\";\n        readonly min: 2;\n        readonly max: 15;\n        readonly step: 0.5;\n        readonly value: 7;\n        readonly unit: \" m/s\";\n        readonly group: \"Landing\";\n    };\n    readonly spoolUp: {\n        readonly label: \"Rotor spool-up\";\n        readonly hint: \"Seconds from a stopped rotor to flight speed with a pilot in. It lifts once the rotor is nearly up to speed.\";\n        readonly min: 1;\n        readonly max: 15;\n        readonly step: 0.5;\n        readonly value: 4;\n        readonly unit: \" s\";\n        readonly group: \"Rotor\";\n    };\n    readonly spoolDown: {\n        readonly label: \"Rotor spool-down\";\n        readonly hint: \"Seconds for the rotor to wind down once it stands on its skids without a pilot.\";\n        readonly min: 2;\n        readonly max: 30;\n        readonly step: 0.5;\n        readonly value: 9;\n        readonly unit: \" s\";\n        readonly group: \"Rotor\";\n    };\n    readonly strikeShove: {\n        readonly label: \"Rotor strike shove\";\n        readonly hint: \"How hard a rotor strike throws it back from what it hit, m/s at a full-speed rotor.\";\n        readonly min: 0;\n        readonly max: 10;\n        readonly step: 0.1;\n        readonly value: 4;\n        readonly unit: \" m/s\";\n        readonly group: \"Damage\";\n    };\n    readonly strikeDamage: {\n        readonly label: \"Rotor strike damage\";\n        readonly hint: \"Share of the airframe a hard rotor strike takes (a light touch takes half).\";\n        readonly min: 0;\n        readonly max: 0.5;\n        readonly step: 0.01;\n        readonly value: 0.12;\n        readonly unit: \"\";\n        readonly group: \"Damage\";\n    };\n    readonly landingDamage: {\n        readonly label: \"Hard landing damage\";\n        readonly hint: \"Share of the airframe each m/s over the hard landing speed takes.\";\n        readonly min: 0;\n        readonly max: 0.5;\n        readonly step: 0.01;\n        readonly value: 0.1;\n        readonly unit: \"\";\n        readonly group: \"Damage\";\n    };\n    readonly bodyWidth: {\n        readonly label: \"Airframe width\";\n        readonly hint: \"The cabin and skids across, m: what bumps into walls (the rotor span is wider).\";\n        readonly min: 1;\n        readonly max: 5;\n        readonly step: 0.05;\n        readonly value: 2.5;\n        readonly unit: \" m\";\n        readonly group: \"Damage\";\n    };\n};\nexport type HeliField = keyof typeof HELI_FIELDS;\nexport type RotorVolume = {\n    part: 'main' | 'tail';\n    center: {\n        x: number;\n        y: number;\n        z: number;\n    };\n    radius: number;\n    axis: 'x' | 'y' | 'z';\n    halfThickness: number;\n};\nexport type HeliConfig = Record<HeliField, number> & {\n    rotors: RotorVolume[];\n};\nexport declare const DEFAULT_ROTORS: RotorVolume[];\nexport declare function defaultHeli(): HeliConfig;\nexport declare function readHeli(value: unknown, rotors?: RotorVolume[]): HeliConfig | undefined;\nexport declare function heliIssues(value: unknown): string[];\nexport interface HeliGround {\n    height(x: number, z: number): number;\n    ready?(x: number, z: number): boolean;\n    water?(x: number, z: number): number | null;\n    solid?(x: number, z: number, y: number, radius: number, height: number): boolean;\n}\nexport type RotorStrike = {\n    part: 'main' | 'tail';\n    x: number;\n    y: number;\n    z: number;\n    speed: number;\n};\nexport declare class Helicopter {\n    x: number;\n    y: number;\n    z: number;\n    vx: number;\n    vz: number;\n    vy: number;\n    heading: number;\n    yawRate: number;\n    pitch: number;\n    roll: number;\n    grounded: boolean;\n    blocked: boolean;\n    waiting: boolean;\n    mass: number;\n    config: HeliConfig;\n    rotor: number;\n    collective: number;\n    cyclicForward: number;\n    cyclicSide: number;\n    pedals: number;\n    airframe: number;\n    altitude: number;\n    wash: number;\n    readonly impacts: VehicleImpact[];\n    readonly strikes: RotorStrike[];\n    landing: {\n        speed: number;\n        slide: number;\n        hard: boolean;\n    } | null;\n    constructor(options?: {\n        x?: number;\n        y?: number;\n        z?: number;\n        heading?: number;\n        mass?: number;\n        config?: HeliConfig;\n    });\n    place(x: number, z: number, heading?: number): void;\n    get flying(): boolean;\n    step(controls: VehicleControls, ground: HeliGround, dt: number): void;\n}\nexport declare const HOVER_HOLD: VehicleControls;\nexport declare function heliWash(heli: Helicopter): {\n    x: number;\n    z: number;\n    reach: number;\n    strength: number;\n} | null;\nexport declare function heliReadout(heli: Helicopter): string;"
        },
        {
          "file": "sprung-car.ts",
          "declarations": "import { VehicleSuspension, type SuspensionConfig } from './suspension';\nimport type { HeightAt, SolidAt, Surface, VehicleControls, VehicleImpact } from './types';\nexport type CarTuning = {\n    topSpeed: number;\n    reverseSpeed: number;\n    accel: number;\n    brake: number;\n    maxSteerDeg: number;\n    grip: number;\n    handbrakeGrip: number;\n    surfaces: Record<Surface, number>;\n};\nexport declare const CAR_TUNING: CarTuning;\nexport declare const CAR_SUSPENSION: SuspensionConfig;\nexport interface CarGround {\n    height: HeightAt;\n    surface?(x: number, z: number): Surface;\n    solid?: SolidAt;\n}\nexport declare class SprungCar {\n    x: number;\n    y: number;\n    z: number;\n    vx: number;\n    vz: number;\n    heading: number;\n    yawRate: number;\n    steering: number;\n    acceleration: number;\n    lateralAcceleration: number;\n    spin: number;\n    blocked: boolean;\n    tuning: CarTuning;\n    readonly suspension: VehicleSuspension;\n    readonly impacts: VehicleImpact[];\n    constructor(options?: {\n        x?: number;\n        z?: number;\n        heading?: number;\n        tuning?: CarTuning;\n        suspension?: SuspensionConfig;\n    });\n    place(x: number, z: number, heading?: number, y?: number): void;\n    get speed(): number;\n    step(controls: VehicleControls, ground: CarGround, dt: number): void;\n}"
        }
      ],
      "pitfalls": [
        "Step at a fixed rate near 60 Hz, or split a long frame into steps of at most 1/60 s",
        "Heading 0 faces -z and positive heading turns left, in every model",
        "Pitch is nose up and roll is the right side up",
        "Give the helicopter the height it can stand on",
        "A helicopter lifts only once the rotor is 70 % spun",
        "Keep `touchdownSpeed` under `hardLanding` (heliIssues says so)",
        "The airboat’s rudders need air on them",
        "The airboat’s top speed comes from thrust per kilo",
        "The suspension has no rollover solver",
        "Swap the helicopter’s config for a new object to retune it",
        "A grapple plan is null when the hold is not 1.5 m over the hands or the arc would not clear the…",
        "Models you are not driving still need stepping with PARKED controls"
      ],
      "card": "entries/vehicle-models.json"
    },
    {
      "id": "vehicle-showcase",
      "aliases": [],
      "name": "Vehicle showcase with x-ray",
      "summary": "A staged bay for any glTF vehicle whose parts are named nodes: a dark studio with a floor that mirrors it softly, framed presets, and modding from the content’s own part definitions (corners, both mirrors and a stripe’s three pieces are one slot each; what a part needs is kept). Each swap is a short ceremony: the old part scans away, the new one scans in along its length and settles. X-ray follows the game’s rules: off, the car as built with the selected part glowing through the body; on, bodywork as glass and the running gear solid, the selected part solid with a sheen. The body wears layered car paint (a base coat whose colour travels with the angle, metal or mica flakes that fade into their average below a few pixels so they never flicker, a deep clear coat that can be tinted) in seven finishes, from solid gloss to a glowing pearl and a colour-shift, all one shader. A fitted active wing rises and pitches on a speed schedule, holds through a dip (hysteresis), stands up as an air brake under hard braking and trims for cornering. Every shader is built before it shows, and nothing is drawn while nothing moves.",
      "category": "ui",
      "role": "hero-visual",
      "stack": [
        "three",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "vehicle",
        "configurator",
        "x-ray",
        "modding",
        "glTF",
        "meshopt",
        "studio",
        "reflector",
        "turntable",
        "camera presets",
        "picking",
        "compileAsync",
        "draw on demand",
        "tsl",
        "car paint",
        "metallic flake",
        "pearlescent",
        "clear coat",
        "anti-aliasing",
        "active aero",
        "speed schedule",
        "hysteresis"
      ],
      "useCases": [
        "car and product configurators",
        "automotive paint: metallic, pearl, candy, satin, colour-shift",
        "a game’s garage or workshop screen",
        "showing what is inside a machine",
        "part pickers with rules",
        "press and review pages for a 3D model",
        "spoilers, flaps and louvres that deploy with speed"
      ],
      "interaction": "Pick a part on the car or in the list · X for x-ray · drag to orbit · click, then scroll to zoom",
      "kits": [
        {
          "kit": "product-presentation",
          "as": "optional"
        },
        {
          "kit": "shop",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "material-designer",
          "why": "Paint and trims as recipes"
        },
        {
          "id": "thin-film",
          "why": "Iridescent paint"
        },
        {
          "id": "camera-director",
          "why": "Framed shots round the vehicle"
        }
      ],
      "variants": [],
      "version": "1.1.2",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "The floor’s mirror drawn at two thirds the size (blurred as wide); the car as it is.",
          "low": "The floor’s mirror at half the size, without MSAA, five blur taps, drawn every other frame; the car as it is."
        },
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 0.872,
          "cpuMs": 2.21,
          "cpuP95Ms": 4.785,
          "badge": "heavy",
          "drawCalls": 314,
          "computeDispatches": 0,
          "frames": null,
          "notes": "The Stiletto SP (139k triangles as fitted) in the bay with its floor mirror (a second pass of the car): a part swapped with its ceremony every 1.2 s, x-ray toggled every 4 s, the camera turning slowly. At rest the bay draws nothing."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 9.503,
          "cpuMs": 4.79,
          "cpuP95Ms": 6.12,
          "badge": "heavy",
          "drawCalls": 318,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 20.762,
            "p99Ms": 29.33,
            "low1Fps": 26.3
          },
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 3619 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 6.587,
          "cpuMs": 1.48,
          "cpuP95Ms": 2.64,
          "badge": "heavy",
          "drawCalls": 212,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 4605 ms."
        }
      ],
      "signatures": [
        {
          "file": "active-aero.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { type AeroState, type OverrideName } from './aero-schedule';\nexport type { AeroState } from './aero-schedule';\nexport type AeroReadout = {\n    heldKmh: number;\n    lift: number;\n    pitch: number;\n    flap: number;\n    override: OverrideName | null;\n};\nexport declare class ActiveAero {\n    get movingNodes(): THREE.Object3D[];\n    get readout(): Readonly<AeroReadout>;\n    constructor(scene: THREE.Object3D, capabilities: readonly unknown[]);\n    step(dt: number, state: AeroState, instant?: boolean): boolean;\n    dispose(): void;\n}"
        },
        {
          "file": "embedded-images.ts",
          "declarations": "import type { GLTFLoaderPlugin, GLTFParser } from 'three/addons/loaders/GLTFLoader.js';\nexport declare function embeddedImages(parser: GLTFParser): GLTFLoaderPlugin;\nexport declare function dataUriBytes(uri: string): Uint8Array;"
        },
        {
          "file": "fitting.ts",
          "declarations": "export type PartDefinition = {\n    id: string;\n    name: string;\n    data: {\n        mountNodes: Record<string, string>;\n        compatibleMounts?: string[];\n        mass?: number;\n        description?: string;\n        capabilities?: {\n            requires?: string[];\n            aero?: unknown;\n            spin?: unknown;\n        };\n    };\n};\nexport type OpenableDefinition = {\n    node?: string;\n    axis: 'x' | 'y' | 'z';\n    angle: number;\n    reveals?: string;\n};\nexport type VehicleDefinition = {\n    id: string;\n    name: string;\n    data: {\n        mounts: Record<string, string>;\n        installedParts: Record<string, string | null>;\n        openables?: Record<string, OpenableDefinition>;\n        wheels?: Record<string, {\n            spin?: string;\n            steer?: string;\n            [key: string]: unknown;\n        }>;\n        wheelRadius?: number;\n        dimensions?: {\n            length?: number;\n            width?: number;\n            height?: number;\n            [key: string]: unknown;\n        };\n        [key: string]: unknown;\n    };\n};\nexport type SlotOption = {\n    id: string;\n    name: string;\n    parts: Record<string, string>;\n    description?: string;\n    mass: number;\n    requires: string[];\n};\nexport type Slot = {\n    id: string;\n    mounts: string[];\n    options: SlotOption[];\n    allowEmpty: boolean;\n};\nexport type Fit = Record<string, string | null>;\nexport type Kit = {\n    vehicle: VehicleDefinition;\n    parts: Map<string, PartDefinition>;\n    mounts: string[];\n    slots: Slot[];\n    candidates: Map<string, Set<string>>;\n    permanent: Set<string>;\n};\nexport declare function createKit(vehicle: VehicleDefinition, parts: PartDefinition[]): Kit;\nexport declare const factoryFit: (kit: Kit) => Fit;\nexport declare const slotById: (kit: Kit, id: string) => Slot | undefined;\nexport declare function optionAt(kit: Kit, fit: Fit, slotId: string): SlotOption | null;\nexport type Blocked = {\n    needs: string[];\n    neededBy: string[];\n};\nexport declare function blocked(kit: Kit, fit: Fit, slotId: string, optionId: string | null): Blocked | null;\nexport declare function withOption(kit: Kit, fit: Fit, slotId: string, optionId: string | null): Fit;\nexport declare function nodeAt(kit: Kit, fit: Fit, mount: string): string | null;\nexport declare function visibility(kit: Kit, fit: Fit): {\n    shown: Set<string>;\n    hidden: Set<string>;\n};\nexport declare function changes(kit: Kit, before: Fit, after: Fit): Array<{\n    mount: string;\n    from: string | null;\n    to: string | null;\n}>;\nexport declare function slotOfNode(kit: Kit): Map<string, string>;"
        },
        {
          "file": "meshopt-auto.ts",
          "declarations": "import { type MeshoptDecoderLike } from './meshopt-decoder';\nexport type MeshoptKind = 'wasm' | 'js';\nexport declare function policyForbidsWasm(policy: string): boolean;\nexport declare function wasmRuns(): Promise<boolean>;\nexport declare function pickMeshoptDecoder(): Promise<{\n    kind: MeshoptKind;\n    decoder: MeshoptDecoderLike;\n}>;\nexport declare const meshoptKind: () => MeshoptKind | undefined;\nexport declare const MeshoptDecoderAuto: MeshoptDecoderLike;"
        },
        {
          "file": "panel.ts",
          "declarations": "import type { Showcase, ViewName } from './showcase';\nexport type PanelSlot = {\n    id: string;\n    label: string;\n    group: string;\n};\nexport type PanelGroup = {\n    id: string;\n    label: string;\n};\nexport type Swatch = {\n    id: string;\n    label: string;\n    value: string;\n};\nexport type PanelOptions = {\n    title: string;\n    groups: PanelGroup[];\n    slots: PanelSlot[];\n    paint?: {\n        group: string;\n        label?: string;\n        colours: Swatch[];\n        calipers?: Swatch[];\n    };\n    openables?: Array<{\n        label: string;\n        ids: string[];\n        icon?: 'doors' | 'bonnet' | 'cover';\n    }>;\n    views?: ViewName[];\n    pick?: boolean;\n    start?: string;\n    frame?: boolean;\n    reducedMotion?: boolean;\n};\nexport type Panel = {\n    readonly element: HTMLElement;\n    show(slot: string): void;\n    syncAccent(): void;\n    setFrame(on: boolean): void;\n    setReducedMotion(on: boolean): void;\n    dispose(): void;\n};\nexport declare function createShowcasePanel(host: HTMLElement, showcase: Showcase, options: PanelOptions): Panel;"
        },
        {
          "file": "showcase.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { createKit, factoryFit, optionAt, type Blocked, type Fit, type Kit, type PartDefinition, type VehicleDefinition } from './fitting';\nimport { type Bay, type BayOptions, type BayTier } from './bay';\nimport type { Finish, PaintSlot } from './appearance';\nimport { type AeroReadout, type AeroState } from './active-aero';\nexport declare const RUNNING_GEAR: RegExp;\nexport declare const UNDER_COVER: Set<string>;\nexport type ViewName = 'front' | 'side' | 'rear' | 'top' | 'wheel' | 'engine';\nexport declare const VIEWS: Record<ViewName, {\n    label: string;\n    yaw: number;\n    pitch: number;\n    focus?: 'wheel' | 'engine';\n}>;\nexport type ControlsLike = THREE.EventDispatcher<{\n    start: object;\n    change: object;\n}> & {\n    target: THREE.Vector3;\n    update(): unknown;\n    minDistance: number;\n    maxDistance: number;\n    maxPolarAngle: number;\n};\nexport type ShowcaseOptions = {\n    renderer: THREE.WebGPURenderer;\n    scene: THREE.Scene;\n    camera: THREE.PerspectiveCamera;\n    controls?: ControlsLike | null;\n    model: THREE.Object3D;\n    vehicle: VehicleDefinition;\n    parts: PartDefinition[];\n    accent?: string;\n    bay?: BayOptions | false;\n    tier?: BayTier;\n    reducedMotion?: boolean;\n    runningGear?: (object: THREE.Object3D) => boolean;\n    revealedBy?: Record<string, string>;\n};\nexport type ShowcaseEvent = {\n    type: 'fit';\n    slot: string;\n    option: string | null;\n} | {\n    type: 'select';\n    slot: string | null;\n} | {\n    type: 'xray';\n    on: boolean;\n} | {\n    type: 'open';\n    openable: string;\n    open: boolean;\n} | {\n    type: 'paint';\n    slot: PaintSlot;\n    colour: string | null;\n    finish: Finish;\n};\nexport type Pick = {\n    slot?: string;\n    openable?: string;\n    body?: boolean;\n};\nexport type Showcase = {\n    readonly kit: Kit;\n    readonly fit: Fit;\n    readonly selected: string | null;\n    readonly xray: boolean;\n    readonly holder: THREE.Group;\n    readonly canvas: HTMLCanvasElement;\n    setInsets(insets: {\n        left?: number;\n        right?: number;\n        top?: number;\n        bottom?: number;\n    }): void;\n    readonly bay: Bay | null;\n    warm(): Promise<void>;\n    select(slot: string | null, options?: {\n        frame?: boolean;\n    }): void;\n    blocked(slot: string, option: string | null): Blocked | null;\n    fitOption(slot: string, option: string | null): Promise<boolean>;\n    setFit(fit: Fit): Promise<void>;\n    setXray(on: boolean): void;\n    view(name: ViewName, options?: {\n        instant?: boolean;\n    }): void;\n    readonly openables: Array<{\n        id: string;\n        open: boolean;\n    }>;\n    open(openable: string, open?: boolean): void;\n    paint(slot: PaintSlot, colour: string | null, finish?: Finish): void;\n    setAccent(css: string): void;\n    drive(state: Partial<AeroState>): void;\n    readonly aero: Readonly<AeroReadout> | null;\n    pick(x: number, y: number): Pick | null;\n    update(dt: number): boolean;\n    invalidate(): void;\n    setReducedMotion(on: boolean): void;\n    on(listener: (event: ShowcaseEvent) => void): () => void;\n    dispose(): void;\n};\nexport declare function createShowcase(options: ShowcaseOptions): Showcase;\nexport { createKit, factoryFit, optionAt };"
        }
      ],
      "pitfalls": [
        "A strict Content Security Policy breaks the Stiletto twice",
        "The x-ray rule is the selected part’s alone",
        "A part’s nodes are found by the content, not by name patterns",
        "Running gear is matched by name (`RUNNING_GEAR`), and `Engine` must not take in `EngineCover`",
        "Under x-ray, pick the solid parts first",
        "Paint as uniforms: a finish that turns clearcoat, sheen or iridescence on as a value",
        "Flakes smaller than a pixel sparkle a pixel at a time and flash as the camera moves",
        "Flakes in a 3D grid (cells in the mesh’s own space, no UVs) show stripes where a panel lies…",
        "A flake drawn as its own little mirror in the paint’s lighting comes out darker than the paint…",
        "Near-white paint sits on the tone mapper’s shoulder, where tints are squeezed out",
        "One material serves many parts (the carbon, the body paint)",
        "The floor mirror (`reflector`) renders once a node frame",
        "See-through double-sided glass is drawn in two passes and compiled as a third variant unless…",
        "Compile every part, x-ray glass on every layout and both marks at load",
        "Frame with what the panel leaves",
        "A speed schedule read at the road speed alone makes the wing hunt",
        "ActiveAero takes each node’s pose as it finds it as the stowed one",
        "Draw on demand: the bay draws while the camera, a hinge, a sweep or the marks’ breathing moves",
        "On an integrated GPU, lighten the floor mirror, not the car"
      ],
      "card": "entries/vehicle-showcase.json"
    },
    {
      "id": "version-history",
      "aliases": [],
      "name": "Automatic version history, thinned with age",
      "summary": "A copy of a document kept by itself a few minutes into each stretch of changes, and named copies on demand; thinned as they age (every copy for two hours, hourly for two days, daily for a month, tiers your own); kept in IndexedDB through a small promise wrapper that reports a full disk or a private window; listed, compared, restored and deleted. The thinning is one pure, tested function. Beside it, a library of drafts: every document its own IndexedDB entry, a Trash to restore from, saves to a document in Trash refused, and a one-time move from an older localStorage library that never deletes it. And a versioned save with a last-good fallback: checked when read, written whole with the save before it kept beside it, migrated up from older versions, never written over by an older app; a save that fails to load falls back to the one before, then to a start that always works, each step with a plain message.",
      "category": "systems",
      "role": "system",
      "stack": [
        "headless"
      ],
      "character": "calm",
      "tags": [
        "version history",
        "autosave",
        "retention",
        "IndexedDB",
        "restore",
        "diff",
        "offline",
        "drafts",
        "trash",
        "migration",
        "save game",
        "last good save",
        "fallback",
        "versioned save",
        "no dependencies"
      ],
      "useCases": [
        "editors and note apps",
        "boards and canvases",
        "design and level tools",
        "long forms and drafts",
        "anything saved only in the browser",
        "a library of documents with a Trash",
        "moving off localStorage",
        "game saves and app state that must never strand the player",
        "settings or documents whose format changes between versions"
      ],
      "interaction": "Type in the notes · skip ahead and watch old copies thin out · open a version to compare or restore it · move a draft to Trash and try saving it · damage the newest save and try loading",
      "kits": [],
      "pairsWith": [
        {
          "id": "labelled-undo",
          "why": "Undo inside a session, copies across sessions"
        },
        {
          "id": "comments-tasks",
          "why": "Threads that survive a restore"
        },
        {
          "id": "sealed-relay",
          "why": "Live collaboration whose copies are kept"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.80",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-04",
          "gpuMs": null,
          "cpuMs": 0.05,
          "cpuP95Ms": 0.085,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the clock at an hour a second and the simulated author writing: each frame moves the clock, keeps any copy due (one IndexedDB transaction, thinned in it), thins in memory as copies age and moves the timeline’s dots; the list redraws four times a second."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 0.08,
          "cpuP95Ms": 0.16,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 150 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0.06,
          "cpuP95Ms": 0.08,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 282 ms."
        }
      ],
      "signatures": [
        {
          "file": "auto-keep.ts",
          "declarations": "export type AutoKeepOptions = {\n    keep: () => unknown;\n    every?: number;\n    now?: () => number;\n    lastAt?: number;\n    timer?: boolean;\n};\nexport type AutoKeeper = {\n    changed(): void;\n    check(): boolean;\n    flush(): boolean;\n    markKept(at?: number): void;\n    due(): number | null;\n    readonly lastAt: number;\n    readonly pending: boolean;\n    every: number;\n    dispose(): void;\n};\nexport declare function autoKeep(options: AutoKeepOptions): AutoKeeper;"
        },
        {
          "file": "compare.ts",
          "declarations": "export declare function formatBytes(bytes: number, locale?: string): string;\nexport declare function sizeChange(from: number, to: number, locale?: string): {\n    bytes: number;\n    ratio: number;\n    text: string;\n};\nexport declare function ago(at: number, now: number, locale?: string, style?: Intl.RelativeTimeFormatStyle): string;\nexport type LineChange = {\n    kind: 'same' | 'added' | 'removed';\n    text: string;\n};\nexport declare function diffLines(a: string, b: string, limit?: number): LineChange[] | null;\nexport declare function diffSummary(changes: readonly LineChange[]): {\n    added: number;\n    removed: number;\n    text: string;\n};"
        },
        {
          "file": "draft-list.ts",
          "declarations": "export type Draft<T> = {\n    id: string;\n    data: T;\n    updatedAt: string;\n    deletedAt: string | null;\n};\nexport type DraftErrorCode = 'trashed' | 'full' | 'missing' | 'mismatch' | 'not-trashed' | 'damaged' | 'blocked';\nexport declare class DraftError extends Error {\n    readonly code: DraftErrorCode;\n    constructor(code: DraftErrorCode, message: string);\n}\nexport declare const MAX_DRAFTS = 100;\nexport type ParseDraftsOptions<T> = {\n    parse?: (data: unknown) => T;\n    idOf: (data: T) => string;\n    field?: string;\n    max?: number;\n};\nexport declare function parseDraftList<T>(list: unknown, o: ParseDraftsOptions<T>): Draft<T>[];\nexport declare function readLegacyDrafts<T>(storage: Pick<Storage, 'getItem'>, key: string, o: ParseDraftsOptions<T>): Draft<T>[];\nexport declare function splitDrafts<T>(drafts: readonly Draft<T>[]): {\n    live: Draft<T>[];\n    trash: Draft<T>[];\n};"
        },
        {
          "file": "drafts.ts",
          "declarations": "import { type Draft } from './draft-list';\nexport type DraftsLoaded<T> = {\n    drafts: Draft<T>[];\n    recovery?: T;\n    warning: string;\n};\nexport type LegacyDrafts = {\n    storage: Pick<Storage, 'getItem'>;\n    drafts: string;\n    recovery?: string;\n    field?: string;\n};\nexport type DraftLibraryOptions<T> = {\n    idOf: (data: T) => string;\n    parse?: (data: unknown) => T;\n    name?: string;\n    factory?: IDBFactory;\n    legacy?: LegacyDrafts;\n    max?: number;\n    now?: () => number;\n};\nexport type DraftLibrary<T> = {\n    load(): Promise<DraftsLoaded<T>>;\n    save(data: T, options?: {\n        recovery?: boolean;\n    }): Promise<Draft<T>[]>;\n    trash(id: string, current?: T): Promise<Draft<T>[]>;\n    restore(id: string): Promise<Draft<T>[]>;\n    erase(id: string): Promise<Draft<T>[]>;\n    dropRecovery(): Promise<void>;\n    close(): Promise<void>;\n};\nexport declare function createDraftLibrary<T>(options: DraftLibraryOptions<T>): DraftLibrary<T>;"
        },
        {
          "file": "last-good.ts",
          "declarations": "export type Saved<T> = {\n    version: number;\n    savedAt: string;\n    data: T;\n};\nexport type SaveRow<T> = {\n    current: Saved<T> | null;\n    previous: Saved<T> | null;\n};\nexport type SaveFormat<T> = {\n    version: number;\n    check(data: unknown): T;\n    migrate?: Record<number, (data: unknown) => unknown>;\n};\nexport declare const KEEP_PREVIOUS_MS = 60000;\nexport declare function readSaved<T>(value: unknown, format: SaveFormat<T>): {\n    save: Saved<T> | null;\n    newer: boolean;\n};\nexport declare function parseSave<T>(value: unknown, format: SaveFormat<T>): Saved<T> | null;\nexport type ReadRow<T> = SaveRow<T> & {\n    damaged: boolean;\n    newer: boolean;\n};\nexport declare function readRow<T>(text: string | null | undefined, format: SaveFormat<T>): ReadRow<T>;\nexport declare function rotate<T>(row: SaveRow<T>, next: Saved<T>, keepPrevious?: number): SaveRow<T>;\nexport interface SaveRows {\n    read(): Promise<{\n        state: string;\n        revision: number;\n    } | null>;\n    write(state: string, revision: number): Promise<boolean>;\n}\nexport type Usable<T> = (data: T) => string | null | Promise<string | null>;\nexport type LoadedSaves<T> = SaveRow<T> & {\n    notes: string[];\n};\nexport declare function loadSaves<T>(rows: SaveRows, format: SaveFormat<T>, usable?: Usable<T>): Promise<LoadedSaves<T>>;\nexport type StoreResult<T> = {\n    ok: true;\n    save: Saved<T>;\n} | {\n    ok: false;\n    error: string;\n};\nexport declare function storeSave<T>(rows: SaveRows, data: unknown, format: SaveFormat<T>, options?: {\n    now?: Date;\n    usable?: Usable<T>;\n    keepPrevious?: number;\n}): Promise<StoreResult<T>>;\nexport type StartChoice<T> = {\n    from: 'save' | 'previous' | 'start';\n    data: T;\n    message: string | null;\n};\nexport declare function chooseStart<T>(loaded: LoadedSaves<T> | null, start: T, usable?: Usable<T>, startName?: string): Promise<StartChoice<T>>;"
        },
        {
          "file": "store.ts",
          "declarations": "import { type ThinOptions, type Tier } from './thin';\nexport type Version = {\n    id: number;\n    doc: string;\n    at: number;\n    size: number;\n    label?: string;\n};\nexport type KeepItem = {\n    data: unknown;\n    at?: number;\n    label?: string;\n    size?: number;\n};\nexport type StoreTrouble = 'unavailable' | 'quota' | 'error';\nexport type KeepResult = {\n    ok: true;\n    versions: Version[];\n    dropped: number[];\n} | {\n    ok: false;\n    reason: StoreTrouble;\n    error?: unknown;\n};\nexport type VersionStoreOptions = ThinOptions & {\n    name?: string;\n    tiers?: readonly Tier[];\n    now?: () => number;\n};\nexport type VersionStore = {\n    keep(doc: string, data: unknown, options?: {\n        label?: string;\n        at?: number;\n        size?: number;\n    }): Promise<KeepResult>;\n    keepAll(doc: string, items: readonly KeepItem[], now?: number): Promise<KeepResult>;\n    list(doc: string): Promise<Version[]>;\n    read<T = unknown>(id: number): Promise<T | undefined>;\n    rename(id: number, label: string): Promise<boolean>;\n    remove(id: number): Promise<boolean>;\n    thinNow(doc: string, now?: number): Promise<number[]>;\n    forget(doc: string): Promise<void>;\n    destroy(): Promise<void>;\n    close(): void;\n    tiers: readonly Tier[];\n    thinOptions: ThinOptions;\n};\nexport declare function sizeOf(data: unknown): number;\nexport declare function openVersionStore(options?: VersionStoreOptions): VersionStore;"
        },
        {
          "file": "thin.ts",
          "declarations": "export declare const MINUTE = 60000;\nexport declare const HOUR: number;\nexport declare const DAY: number;\nexport type Tier = {\n    upTo: number;\n    every: number;\n};\nexport declare const DEFAULT_TIERS: readonly Tier[];\nexport declare const KEEP_EVERY: number;\nexport type ThinOptions = {\n    max?: number;\n    offset?: number;\n};\nexport declare const shouldKeep: (lastAt: number, changedAt: number, now: number, every?: number) => boolean;\nexport declare function tierOf(t: number, now: number, tiers?: readonly Tier[]): number;\nexport declare function thin(times: readonly number[], now: number, tiers?: readonly Tier[], options?: ThinOptions): number[];\nexport declare function mostKept(tiers: readonly Tier[], every?: number): number;"
        }
      ],
      "pitfalls": [
        "Thin after every copy kept and when time passes",
        "Name what must never go: thinning only ever looks at unnamed copies",
        "Keep copies on this device apart from the document people sync",
        "Days are cut in UTC unless you pass offset",
        "A storage error is a result, not an exception",
        "Keep a copy of what is there before restoring",
        "IndexedDB is per origin and per browser",
        "Moving off localStorage, never delete the old key",
        "A save must refuse a document in Trash, inside the transaction that would write it",
        "Trash the open document with its latest edits",
        "Wait for the transaction’s complete event, not the request’s success",
        "The limit counts Trash too",
        "Keep the last good save beside the newest, in the same row, written whole",
        "Move the newest save to “the one before” only once it is a while older than the one already…",
        "Read a damaged save as missing, never as an error, and say so once in plain words",
        "Never write over a save made by a newer version of the app",
        "Tell “could not be read” (the storage or network failed) apart from “there is none”"
      ],
      "card": "entries/version-history.json"
    },
    {
      "id": "video-textures",
      "aliases": [],
      "name": "Video textures and walkthrough player",
      "summary": "Pre-recorded video inside a WebGPU scene and in the page, stage-grade. Each video decodes only while it holds a slot in a decode budget (at most N at once, the rest queued on their stills, a more important one taking a slot back); it is prerolled to an exact frame before its moment; every new frame is caught with requestVideoFrameCallback and drawn as a zero-copy external texture (or copied once), with a glow that lights the stage in its colours. On top, a walkthrough player: chapters with keyframe-aware exact seeks, captions, and rings at the recorded clicks timed by the video’s own clock, stepping chapter by chapter, looping one slowly or playing through at an effect speed, with a still per chapter that carries the same facts. And a click guide over stills: one step per click, the cursor gliding to where the click goes, the target lit and the rest dimmed, a ring, typed text and the step’s words, every still decoded to an ImageBitmap before it is first shown, drawing only while something moves.",
      "category": "technique",
      "role": "system",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "calm",
      "tags": [
        "video",
        "video texture",
        "importExternalTexture",
        "external texture",
        "requestVideoFrameCallback",
        "WebCodecs",
        "decode budget",
        "preroll",
        "seamless loop",
        "exact seek",
        "keyframes",
        "chapters",
        "captions",
        "walkthrough",
        "click rings",
        "stills fallback",
        "click guide",
        "screenshots",
        "ImageBitmap",
        "createImageBitmap",
        "decode",
        "playback rate",
        "stage",
        "webgpu",
        "dom",
        "accessibility",
        "keyboard",
        "touch",
        "no dependencies"
      ],
      "useCases": [
        "app walkthrough videos in a live presentation, stepped chapter by chapter from a clicker",
        "video screens inside a 3D or WebGPU scene that light their surroundings",
        "several looping background videos without running out of decoders",
        "a product tour recorded once, with its clicks highlighted and captions in the page",
        "a kiosk or wall that must never show a black frame or a spinner",
        "a product tour from screenshots, stepped click by click from a clicker"
      ],
      "interaction": "Space plays and pauses · ← → move between chapters · click the screen to pause · in the click guide, a click on the still is the next step",
      "kits": [
        {
          "kit": "product-presentation",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "segment-loader",
          "why": "Load and release videos by segment"
        },
        {
          "id": "slide-transitions",
          "why": "Transitions between video slides"
        },
        {
          "id": "cue-console",
          "why": "Start videos from cues"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 0.093,
          "cpuMs": 0.32,
          "cpuP95Ms": 0.67,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with two videos decoding and drawn as zero-copy external textures with their glow: the walkthrough playing through (960 × 540, 30 fps) and one ambient loop (480 × 270), the second loop waiting on its still (two decoders at once). The canvas redraws only when either video presents a new frame, about 30 times a second; GPU time is the layer’s pass, from its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.131,
          "cpuMs": 0.51,
          "cpuP95Ms": 0.985,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.67,
            "p99Ms": 17.985,
            "low1Fps": 54.9
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 4380 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 6.839,
          "cpuMs": 0.14,
          "cpuP95Ms": 0.32,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 482 ms."
        }
      ],
      "signatures": [
        {
          "file": "click-guide-player.ts",
          "declarations": "import { type ClickGuide, type GuidePose, type GuideScreen, type GuideStep } from './click-guide';\nexport type GuideLabels = {\n    guide: string;\n    previous: string;\n    next: string;\n    steps: string;\n    step: (index: number, count: number, step: GuideStep) => string;\n    end: string;\n    loading: string;\n};\nexport type Still = ImageBitmap | HTMLCanvasElement | OffscreenCanvas;\nexport type ClickGuidePlayerOptions = {\n    guide: ClickGuide;\n    load?: (screen: GuideScreen, index: number) => Promise<Still>;\n    cursor?: boolean;\n    start?: number;\n    labels?: Partial<GuideLabels>;\n    reducedMotion?: boolean;\n    renderOver?: (ctx: CanvasRenderingContext2D, pose: GuidePose, size: {\n        width: number;\n        height: number;\n    }) => void;\n    onStep?: (index: number, step: GuideStep) => void;\n};\nexport type ClickGuidePlayer = {\n    readonly element: HTMLElement;\n    readonly canvas: HTMLCanvasElement;\n    readonly screen: number;\n    readonly index: number;\n    readonly ready: Promise<void>;\n    go(index: number): void;\n    next(): void;\n    prev(): void;\n    redraw(): void;\n    destroy(): void;\n};\nexport declare function decodeStill(src: string, size?: {\n    width: number;\n    height: number;\n}): Promise<ImageBitmap>;\nexport declare function createClickGuide(host: HTMLElement, options: ClickGuidePlayerOptions): ClickGuidePlayer;"
        },
        {
          "file": "click-guide.ts",
          "declarations": "export type GuideBox = [\n    number,\n    number,\n    number,\n    number\n];\nexport type GuideStep = {\n    screen: number;\n    action?: 'show' | 'highlight' | 'click' | 'type';\n    x?: number;\n    y?: number;\n    box?: GuideBox;\n    caption?: string;\n    label?: string;\n    typed?: string;\n};\nexport type GuideScreen = {\n    image: string;\n    title?: string;\n};\nexport type ClickGuide = {\n    width: number;\n    height: number;\n    screens: GuideScreen[];\n    steps: GuideStep[];\n};\nexport declare const GUIDE_TIMING: {\n    move: number;\n    ripple: number;\n    dim: number;\n    type: number;\n};\nexport type GuideTiming = typeof GUIDE_TIMING;\nexport declare function parseBox(input?: string | readonly number[] | null): GuideBox | null;\nexport declare const smootherstep: (u: number) => number;\nexport type GuidePose = {\n    cursor: {\n        x: number;\n        y: number;\n    } | null;\n    spot: {\n        x: number;\n        y: number;\n        w: number;\n        h: number;\n        round: boolean;\n    } | null;\n    dim: number;\n    ring: {\n        x: number;\n        y: number;\n        k: number;\n        still: boolean;\n    } | null;\n    label: {\n        text: string;\n        x: number;\n        y: number;\n    } | null;\n    typed: string;\n    caret: boolean;\n    moving: boolean;\n};\nexport declare function guidePose(guide: ClickGuide, index: number, t: number, options?: {\n    reduced?: boolean;\n    timing?: GuideTiming;\n}): GuidePose;\nexport declare function stillsInOrder(guide: ClickGuide): number[];"
        },
        {
          "file": "decode-budget.ts",
          "declarations": "export type BudgetHandlers = {\n    onGrant?(): void;\n    onRevoke?(): void;\n};\nexport type BudgetTicket = {\n    readonly id: string;\n    readonly granted: boolean;\n    readonly priority: number;\n    setPriority(priority: number): void;\n    release(): void;\n};\nexport type DecodeBudget = {\n    request(id: string, options?: BudgetHandlers & {\n        priority?: number;\n    }): BudgetTicket;\n    setMax(max: number): void;\n    readonly max: number;\n    active(): string[];\n    queued(): string[];\n    onChange?: () => void;\n};\nexport declare function createDecodeBudget({ max }?: {\n    max?: number | undefined;\n}): DecodeBudget;"
        },
        {
          "file": "video-layer.ts",
          "declarations": "export type Rect = {\n    x: number;\n    y: number;\n    width: number;\n    height: number;\n};\nexport type LayerItem = {\n    video?: HTMLVideoElement | VideoFrame | null;\n    version?: number;\n    still?: GPUTexture | null;\n    rect: Rect;\n    radius?: number;\n    opacity?: number;\n    fit?: 'cover' | 'contain' | 'fill';\n    glow?: number;\n    glowStrength?: number;\n};\nexport type VideoLayerOptions = {\n    format: GPUTextureFormat;\n    mode?: 'auto' | 'external' | 'copy';\n    maxItems?: number;\n    sampleCount?: number;\n};\nexport type VideoLayer = {\n    draw(pass: GPURenderPassEncoder, items: readonly LayerItem[], width: number, height: number): void;\n    upload(image: ImageBitmap | HTMLImageElement | HTMLCanvasElement | OffscreenCanvas | HTMLVideoElement): GPUTexture;\n    readonly ready: Promise<void>;\n    readonly mode: 'external' | 'copy';\n    forget(video: HTMLVideoElement | VideoFrame): void;\n    dispose(): void;\n};\nexport declare function createVideoLayer(device: GPUDevice, { format, mode, maxItems, sampleCount }: VideoLayerOptions): VideoLayer;"
        },
        {
          "file": "video-source.ts",
          "declarations": "import type { DecodeBudget } from './decode-budget';\nexport type VideoState = 'idle' | 'queued' | 'loading' | 'ready' | 'playing' | 'paused' | 'parked' | 'error';\nexport type FrameInfo = {\n    mediaTime: number;\n    presentedFrames: number;\n    width: number;\n    height: number;\n};\nexport type VideoSourceOptions = {\n    src: string;\n    budget?: DecodeBudget;\n    priority?: number;\n    id?: string;\n    loop?: boolean;\n    rate?: number;\n    fps?: number;\n    crossOrigin?: '' | 'anonymous' | 'use-credentials';\n    document?: Document;\n};\nexport type VideoSource = {\n    readonly video: HTMLVideoElement;\n    readonly state: VideoState;\n    readonly mediaTime: number;\n    readonly version: number;\n    readonly hasFrame: boolean;\n    preroll(at?: number): Promise<boolean>;\n    play(): Promise<void>;\n    pause(): void;\n    seek(t: number, options?: {\n        exact?: boolean;\n    }): Promise<void>;\n    setRate(rate: number): void;\n    setLoop(loop: boolean): void;\n    setPriority(priority: number): void;\n    park(): void;\n    quality(): {\n        total: number;\n        dropped: number;\n    };\n    subscribe(listener: {\n        frame?(info: FrameInfo): void;\n        state?(state: VideoState): void;\n    }): () => void;\n    dispose(): void;\n};\nexport declare function createVideoSource(options: VideoSourceOptions): VideoSource;\nexport declare function checkDecoding(contentType: string, width: number, height: number, framerate?: number, bitrate?: number): Promise<{\n    supported: boolean;\n    smooth: boolean;\n    powerEfficient: boolean;\n} | null>;"
        },
        {
          "file": "walkthrough-player.ts",
          "declarations": "import type { VideoSource } from './video-source';\nimport { type Chapter, type Click, type PlayMode, type RingTiming, type SeekPlan, type Walkthrough } from './walkthrough';\nexport type PlayerState = 'loading' | 'still' | 'playing' | 'paused' | 'held';\nexport type PlayerPhase = 'chapter' | 'still-in' | 'still-out';\nexport type PlayerLabels = {\n    player: string;\n    play: string;\n    pause: string;\n    previous: string;\n    next: string;\n    chapters: string;\n    chapter: (index: number, count: number, title: string) => string;\n    held: (index: number, next: string | null) => string;\n    still: string;\n    clicks: (labels: string[]) => string;\n};\nexport type WalkthroughPlayerOptions = {\n    script: Walkthrough;\n    source?: VideoSource | null;\n    display?: 'video' | 'none';\n    mode?: PlayMode;\n    speed?: number;\n    loopRate?: number;\n    autoplay?: boolean;\n    still?: boolean;\n    rings?: boolean;\n    captions?: boolean;\n    ringTiming?: RingTiming;\n    labels?: Partial<PlayerLabels>;\n    renderRing?(el: HTMLElement, click: Click, index: number): void;\n    renderChapter?(el: HTMLButtonElement, chapter: Chapter, index: number): void;\n    animate?(el: HTMLElement, phase: PlayerPhase, context: {\n        reducedMotion: boolean;\n    }): Promise<unknown> | void;\n    onChapter?(index: number, chapter: Chapter): void;\n    onSeek?(plan: SeekPlan): void;\n    onState?(state: PlayerState): void;\n};\nexport type WalkthroughPlayer = {\n    readonly element: HTMLElement;\n    readonly screen: HTMLElement;\n    readonly chapter: number;\n    readonly state: PlayerState;\n    readonly showingStill: boolean;\n    go(index: number, options?: {\n        play?: boolean;\n    }): Promise<void>;\n    next(): Promise<void>;\n    prev(): Promise<void>;\n    play(): Promise<void>;\n    pause(): void;\n    toggle(): void;\n    setMode(mode: PlayMode): void;\n    setSpeed(speed: number): void;\n    setStill(on: boolean): void;\n    setRings(on: boolean): void;\n    setCaptions(on: boolean): void;\n    setScript(script: Walkthrough): void;\n    destroy(): void;\n};\nexport declare function createWalkthroughPlayer(host: HTMLElement, options: WalkthroughPlayerOptions): WalkthroughPlayer;"
        },
        {
          "file": "walkthrough.ts",
          "declarations": "export type Chapter = {\n    id: string;\n    title: string;\n    start: number;\n    end: number;\n    still?: string;\n};\nexport type Caption = {\n    start: number;\n    end: number;\n    text: string;\n};\nexport type Click = {\n    t: number;\n    x: number;\n    y: number;\n    label?: string;\n};\nexport type Walkthrough = {\n    width: number;\n    height: number;\n    fps: number;\n    duration: number;\n    chapters: Chapter[];\n    captions: Caption[];\n    clicks: Click[];\n    keyframes?: number[];\n};\nexport declare function parseWalkthrough(input: unknown): {\n    script: Walkthrough | null;\n    errors: string[];\n};\nexport declare function chapterAt(chapters: readonly Chapter[], t: number): number;\nexport declare function captionAt(captions: readonly Caption[], t: number): Caption | null;\nexport declare const captionsIn: (captions: readonly Caption[], ch: Chapter) => Caption[];\nexport declare const clicksIn: (clicks: readonly Click[], ch: Chapter) => Click[];\nexport type RingTiming = {\n    lead: number;\n    hold: number;\n    fade: number;\n};\nexport declare const RING_TIMING: RingTiming;\nexport type RingPhase = 'in' | 'on' | 'out';\nexport type Ring = {\n    index: number;\n    click: Click;\n    phase: RingPhase;\n    p: number;\n};\nexport declare function ringsAt(clicks: readonly Click[], t: number, timing?: RingTiming, out?: Ring[]): Ring[];\nexport declare const frameAt: (t: number, fps: number) => number;\nexport declare const frameTime: (frame: number, fps: number) => number;\nexport declare const snapToFrame: (t: number, fps: number) => number;\nexport declare const lastFrameBefore: (end: number, fps: number) => number;\nexport type SeekPlan = {\n    time: number;\n    frame: number;\n    keyframe: number | null;\n    decode: number | null;\n};\nexport declare function planSeek(t: number, fps: number, keyframes?: readonly number[]): SeekPlan;\nexport declare function forceKeyFrames(chapters: readonly Chapter[]): string;\nexport type PlayMode = 'step' | 'loop' | 'play';\nexport type FrameAction = {\n    kind: 'none';\n} | {\n    kind: 'hold';\n    at: number;\n} | {\n    kind: 'loop';\n    to: number;\n};\nexport declare function frameAction(mode: PlayMode, mediaTime: number, chapter: Chapter, fps: number, rate?: number): FrameAction;\nexport declare function contentBox(boxW: number, boxH: number, mediaW: number, mediaH: number, fit?: 'contain' | 'cover' | 'fill'): {\n    x: number;\n    y: number;\n    width: number;\n    height: number;\n};\nexport declare function formatTime(t: number): string;"
        }
      ],
      "pitfalls": [
        "An external texture lives until the end of the task that imported it",
        "Removing a playing video element from the document pauses it (the HTML rule)",
        "Exact seeks decode from the keyframe before the target",
        "Seek to the middle of a frame, not its start (frameTime() does)",
        "The browser’s own loop (the loop attribute) is the seamless one",
        "Each playing video holds a decoder and a few frames of memory, and hardware decoders are few",
        "Hardware decoding depends on the codec, the size and the device",
        "requestVideoFrameCallback fires per presented frame, so a video nobody draws",
        "Rings and captions are timed by the frame’s media time, not the clock",
        "Serve video as files from your own origin",
        "Import video-textures.base.css before video-textures.css",
        "Decode a still to an ImageBitmap before it is first shown (img.decode(), then createImageBitmap)",
        "The click guide draws on its canvas only while something moves (the glide, the ring, typing)"
      ],
      "card": "entries/video-textures.json"
    },
    {
      "id": "volumetric-mist",
      "aliases": [],
      "name": "Volumetric mist with light shafts",
      "summary": "Cold mist from a quarter of a million GPU particles: born at emitters, sinking, curled by a divergence-free flow, spreading off ledges; splatted into a 3D grid with atomics every frame and ray-marched as a volume, lit by one directional or spot light with shafts, shadows and a Henyey–Greenstein glow; dust motes drift through the room and show only where the light reaches them.",
      "category": "particles",
      "role": "hero-visual",
      "stack": [
        "webgpu"
      ],
      "character": "balanced",
      "tags": [
        "raw webgpu",
        "wgsl",
        "compute",
        "atomics",
        "volume rendering",
        "ray marching",
        "god rays",
        "curl noise",
        "fog",
        "dust motes",
        "sunbeams"
      ],
      "useCases": [
        "dry ice and cold fog",
        "mist pouring off a ledge or out of a vessel",
        "light shafts through a window",
        "stage and spotlight haze",
        "ground fog in a scene",
        "title and loading screens",
        "dust in sunbeams through a window or between trees"
      ],
      "interaction": "Move the pointer through the mist to stir it · Pour for a cascade through the light",
      "kits": [],
      "pairsWith": [
        {
          "id": "light-sheets",
          "why": "Light sheets cutting through the mist"
        },
        {
          "id": "lit-height-fog",
          "why": "Fog filling the low ground beyond"
        },
        {
          "id": "physical-sky",
          "why": "The sun that lights it"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 9.314,
          "cpuMs": 0.15,
          "cpuP95Ms": 0.225,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the default 262,144 particles, a 96 × 55 × 78 grid and 36 march steps at half size, the bowl brimming and a pour every nine seconds (the demo pours by itself while measured). All passes timed together with timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 4.85,
          "cpuMs": 0.315,
          "cpuP95Ms": 0.485,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 443 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 8.104,
          "cpuMs": 0.38,
          "cpuP95Ms": 0.6,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 84 ms."
        }
      ],
      "signatures": [
        {
          "file": "mist.ts",
          "declarations": "export type Vec3 = [\n    number,\n    number,\n    number\n];\nexport type MistEmitter = {\n    shape?: 'disc' | 'ring' | 'box';\n    at: Vec3;\n    size: Vec3;\n    velocity?: Vec3;\n    outward?: number;\n    jitter?: number;\n    rate?: number;\n    share?: number;\n    weight?: number;\n    sink?: number;\n};\nexport type MistSolid = ({\n    kind: 'box';\n    min: Vec3;\n    max: Vec3;\n} | {\n    kind: 'cylinder';\n    foot: Vec3;\n    radius: number;\n    height: number;\n}) & {\n    collide?: boolean;\n    occlude?: boolean;\n};\nexport type MistLight = {\n    toLight: Vec3;\n    colour: Vec3;\n    intensity: number;\n    anisotropy?: number;\n    ambient?: number;\n    spot?: {\n        position: Vec3;\n        angle: number;\n        softness?: number;\n    };\n};\nexport type MistFlow = {\n    sink: number;\n    swirl: number;\n    drag: number;\n    spread: number;\n    eddy: number;\n    life: [\n        number,\n        number\n    ];\n};\nexport type MistLook = {\n    density: number;\n    wisps: number;\n    haze: number;\n    absorb: number;\n    shadow: number;\n    tint: Vec3;\n};\nexport type MistCamera = {\n    eye: Vec3;\n    target: Vec3;\n    fovY: number;\n};\nexport type MistDust = {\n    count: number;\n    amount: number;\n    size: number;\n    least: number;\n    breeze: Vec3;\n    bob: number;\n};\nexport type MistOptions = {\n    format: GPUTextureFormat;\n    bounds: {\n        min: Vec3;\n        max: Vec3;\n    };\n    count?: number;\n    grid?: Vec3;\n    lightSteps?: number;\n};\nexport type MistDraw = {\n    encoder: GPUCommandEncoder;\n    target: GPUTextureView;\n    width: number;\n    height: number;\n    depth?: GPUTextureView;\n    camera: MistCamera;\n};\nexport type Mist = {\n    emitters: MistEmitter[];\n    solids: MistSolid[];\n    light: MistLight;\n    flow: MistFlow;\n    look: MistLook;\n    steps: number;\n    jitter: boolean;\n    dust: MistDust;\n    readonly volume: GPUTextureView;\n    readonly sampler: GPUSampler;\n    stir(point: Vec3, velocity: Vec3, radius: number, strength?: number): void;\n    simulate(encoder: GPUCommandEncoder, dt: number): void;\n    draw(frame: MistDraw): void;\n    preroll(seconds: number, dt?: number): Promise<void>;\n    configure(next: {\n        count?: number;\n        grid?: Vec3;\n    }): void;\n    dispose(): void;\n};\nexport declare function createMist(device: GPUDevice, options: MistOptions): Promise<Mist>;"
        }
      ],
      "pitfalls": [
        "Call simulate() once per submitted frame",
        "The depth you give draw() is distance along the camera’s forward axis in a float colour texture",
        "Atomics count in fixed point (1024 to a particle)",
        "The volume only exists inside its box",
        "A grid finer than the particles can fill looks grainy (cells with one particle each)",
        "The mist is marched at half size and spread over full size by depth",
        "Never queue more than one frame ahead (the demo skips a frame while the last is on the GPU)",
        "Never switch a volumetric pass on before the scene has drawn a frame",
        "Dust drawn a pixel or less across twinkles",
        "Dust is lit by the mist’s volume (its green: the light reaching each cell)",
        "Solids are at most eight boxes or upright cylinders, emitters at most eight",
        "The demo needs WebGPU: the mist is stepped in compute, counted into its 3D grid with atomic adds"
      ],
      "card": "entries/volumetric-mist.json"
    },
    {
      "id": "voxel-dissolve",
      "aliases": [],
      "name": "Voxel dissolve",
      "summary": "An element dissolves, or assembles, cell by cell: a CSS Paint Worklet masks it, WAAPI drives a registered property, and the calls return promises. WebGPU cubes fly out of (or land in) the very same cells, because one integer hash gives bit-identical results in the worklet’s JavaScript and the cubes’ WGSL: the CPU sends one small record per element and the GPU works out every cube. Four orders (across, down, radial, random), a ragged or clean front, a run that turns round from where it is, and a short fade under reduced motion or where the worklet is missing.",
      "category": "ui",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "css paint worklet",
        "houdini",
        "mask",
        "web animations",
        "registered custom property",
        "@property",
        "raw webgpu",
        "wgsl",
        "integer hash",
        "particles",
        "transitions",
        "dom + gpu",
        "reduced motion",
        "draw on demand",
        "no dependencies"
      ],
      "useCases": [
        "dismissing a card, a row or a panel",
        "toasts and notices that arrive and leave",
        "dialogs and sheets opening and closing",
        "archiving or clearing a board",
        "revealing content after it loads",
        "game and sci-fi menus"
      ],
      "interaction": "Dismiss a card with ×, bring it back from its place · Show a toast · Archive the week",
      "kits": [],
      "pairsWith": [
        {
          "id": "read-reveals",
          "why": "Passages that reveal as they are read"
        },
        {
          "id": "slide-transitions",
          "why": "Whole pictures turning over"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "motion",
          "in": "module",
          "values": {
            "strict": false,
            "refined": "auto",
            "playful": true
          },
          "note": "false always fades"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 0.007,
          "cpuMs": 0.145,
          "cpuP95Ms": 0.595,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the demo running itself: every 40 frames a card dissolves or assembles (16 px cells, about 300 cubes), a toast comes and goes, and the dialog opens and closes, so the worklet repaints and the cubes fly most of the time. GPU time is the cube pass alone, from its timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.066,
          "cpuMs": 0.185,
          "cpuP95Ms": 0.57,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.685,
            "p99Ms": 18.025,
            "low1Fps": 52.7
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 261 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 0,
          "cpuP95Ms": 0.02,
          "badge": "light",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 172 ms."
        }
      ],
      "signatures": [
        {
          "file": "cube-burst.ts",
          "declarations": "import { type CellSettings, type Mode } from './cells';\nexport type Burst = CellSettings & {\n    rect: {\n        left: number;\n        top: number;\n        width: number;\n        height: number;\n    };\n    mode: Mode;\n    start: number;\n    duration: number;\n    color: string;\n    velocity?: [\n        number,\n        number\n    ];\n    spread?: number;\n    gravity?: number;\n    life?: number;\n    size?: number;\n    density?: number;\n};\nexport type CubeOverlayOptions = {\n    container?: HTMLElement;\n    device?: GPUDevice;\n    loop?: boolean;\n    maxBursts?: number;\n    zIndex?: number;\n    dprCap?: number;\n};\nexport type CubeOverlay = {\n    burst(b: Burst): void;\n    frame(now?: number): boolean;\n    readonly alive: boolean;\n    gpuTime(): number | null;\n    readonly canvas: HTMLCanvasElement;\n    readonly device: GPUDevice;\n    clear(): void;\n    dispose(): void;\n};\nexport declare function createCubeOverlay(options?: CubeOverlayOptions): Promise<CubeOverlay | null>;"
        },
        {
          "file": "dissolve.ts",
          "declarations": "import { type Pattern } from './cells';\nimport type { Burst, CubeOverlay } from './cube-burst';\nexport type CubeStyle = Pick<Burst, 'velocity' | 'spread' | 'gravity' | 'life' | 'size' | 'density'>;\nexport type RunOptions = {\n    duration?: number;\n    delay?: number;\n    cell?: number;\n    pattern?: Pattern;\n    reverse?: boolean;\n    grain?: number;\n    seed?: number;\n    cubes?: boolean | CubeStyle;\n    color?: string;\n    pad?: number;\n    remove?: boolean;\n};\nexport type DissolveOptions = {\n    workletUrl?: string | URL | null;\n    cubes?: CubeOverlay | null;\n    motion?: 'auto' | boolean;\n    paint?: boolean;\n    defaults?: RunOptions;\n};\nexport type VdState = 'shown' | 'hidden' | 'assembling' | 'dissolving';\nexport type Dissolver = {\n    assemble(el: HTMLElement, options?: RunOptions): Promise<boolean>;\n    dissolve(el: HTMLElement, options?: RunOptions): Promise<boolean>;\n    hide(el: HTMLElement): void;\n    show(el: HTMLElement): void;\n    state(el: HTMLElement): VdState;\n    readonly style: 'cells' | 'fade';\n    readonly fadeReason: 'reduced-motion' | 'no-worklet' | 'paint-off' | 'loading' | null;\n    readonly ready: Promise<boolean>;\n    motion: 'auto' | boolean;\n    paint: boolean;\n    cubes: CubeOverlay | null;\n    dispose(): void;\n};\nexport declare function createDissolve(options?: DissolveOptions): Dissolver;"
        }
      ],
      "pitfalls": [
        "The worklet loads by URL and must be same-origin under a strict Content Security Policy",
        "Paint worklets run in Chrome and Edge only (2026)",
        "Keep dissolve-paint.js and cells.ts in step",
        "The mask covers the border box and a pad round it (24 px)",
        "The lit front is drawn by the element’s ::after while it runs",
        "A run sets position: relative on a static element (taken off afterwards)",
        "A dissolve makes the element inert at once and hidden (visibility) at the end",
        "One WAAPI animation drives a registered property",
        "The cubes’ canvas has pointer-events"
      ],
      "card": "entries/voxel-dissolve.json"
    },
    {
      "id": "walk-grid",
      "aliases": [],
      "name": "Pathfinding on a lazy walk grid",
      "summary": "A way round walls and props from one blocked(x, z) question: a grid asked only where the search goes, octile A* on a binary heap with a cap on cells visited (it goes as near as it got when the cap is hit), then pulled straight into the few corners a body walks round. One file, no imports.",
      "category": "systems",
      "role": "system",
      "stack": [
        "headless"
      ],
      "character": "calm",
      "tags": [
        "pathfinding",
        "a*",
        "grid",
        "binary heap",
        "string pulling",
        "path smoothing",
        "navigation",
        "no dependencies"
      ],
      "useCases": [
        "NPCs and guards walking round buildings",
        "click-to-move in top-down games",
        "units on a map that changes",
        "robots and agents in a simulation",
        "routing round obstacles on a floor plan"
      ],
      "interaction": "Paint walls · start on a wall to erase · drag A and B · arrow keys move B",
      "kits": [
        {
          "kit": "game",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "agent-senses",
          "why": "Agents that walk its paths"
        },
        {
          "id": "ray-grid",
          "why": "Line of sight to go with the paths"
        },
        {
          "id": "desire-paths",
          "why": "Trails over open land"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "canvas2d",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.80",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-03",
          "gpuMs": null,
          "cpuMs": 1.367,
          "cpuP95Ms": 3.715,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the start and goal circling the map: the path is planned again every frame (lazy grid, A*, pulling) and the walkers replan within a shared budget of 6,000 cells a frame. The frame time includes the Canvas 2D drawing."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 1.812,
          "cpuP95Ms": 4.34,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 47 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 1.96,
          "cpuP95Ms": 3.34,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 114 ms."
        }
      ],
      "signatures": [
        {
          "file": "walk-grid.ts",
          "declarations": "export type WalkPoint = {\n    x: number;\n    z: number;\n};\nexport type Blocked = (x: number, z: number) => boolean;\nexport type WalkPlan = {\n    points: WalkPoint[];\n    reached: boolean;\n    visited: number;\n};\nexport type WalkPlanOptions = {\n    cell?: number;\n    margin?: number;\n    maxSide?: number;\n    maxVisited?: number;\n    trace?: (trace: WalkTrace) => void;\n};\nexport type WalkTrace = {\n    minX: number;\n    minZ: number;\n    cell: number;\n    w: number;\n    h: number;\n    state: Uint8Array;\n    closed: Uint8Array;\n    raw: WalkPoint[];\n};\nexport declare const WALK_CELL = 0.5;\nexport declare const CLEARANCE = 0.14;\nexport declare function walkClear(a: WalkPoint, b: WalkPoint, blocked: Blocked, clearance?: number): boolean;\nexport declare function planWalk(from: WalkPoint, to: WalkPoint, blocked: Blocked, options?: WalkPlanOptions): WalkPlan;\nexport declare class Progress {\n    readonly seconds: number;\n    readonly distance: number;\n    constructor(seconds?: number, distance?: number);\n    hold(x: number, z: number, now: number): void;\n    stuck(x: number, z: number, now: number): boolean;\n}\nexport declare function cornerAhead(path: readonly WalkPoint[], next: number, at: WalkPoint, near?: number, minTurn?: number): {\n    x: number;\n    z: number;\n    from: number;\n    to: number;\n    side: \"left\" | \"right\";\n} | null;"
        }
      ],
      "pitfalls": [
        "blocked(x, z) must answer for a whole body, its radius included",
        "A goal it cannot reach is not an error",
        "The cap (maxVisited, 3000 by default) is per box",
        "Each plan allocates its grid (about 10 bytes a cell, up to 220 × 220 cells)",
        "A goal further than the box can hold",
        "A start up to 3 cells inside something is moved to the nearest open cell",
        "Coordinates are world metres on the ground plane, x and z"
      ],
      "card": "entries/walk-grid.json"
    },
    {
      "id": "water-ripples",
      "aliases": [],
      "name": "Water ripples, wakes & caustics",
      "summary": "Water that answers what moves through it: boats leave wakes that trail off over tens of metres, a stone skims and rings, a cannonball heaves the deep end, rain stipples the surface. Two pieces you can use apart. The field is Evan Wallace’s wave equation stepped at a fixed 30 Hz on a grid of cells kept as a ring anchored to the world (a cell’s slot is its world cell modulo the grid), so it follows the camera without copying a thing; a nine-cell neighbourhood so rings stay round, an absorbing sponge at the edge so waves run out instead of bouncing back, and a coarse second field four times the reach that carries a wake on past the fine one, faded in so there is never a square edge. Each step stores the slope now and a step before, and the shader eases between them, so the water moves smoothly at any frame rate. The surface reads the slope with Catmull-Rom over 4×4 cells (no terraced rings), tilts by it and a breath of wind, mirrors the sky and the sun, shows the bed bent through it from one frame copy, and lights the bed with real caustics: sunlight refracted through the waves, bunching where they focus it, worked out from screen derivatives with no extra pass. Clear pool, lagoon and swamp looks; a wake sheen in the water’s own colour. Compute on WebGPU; on three’s WebGL2 backend the same step runs as float render-target ping-pong.",
      "category": "simulation",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "balanced",
      "tags": [
        "wave equation",
        "compute",
        "caustics",
        "refraction",
        "catmull-rom",
        "storage buffers",
        "tsl"
      ],
      "useCases": [
        "pools, ponds and lakes",
        "boat and swimmer wakes",
        "rain on water",
        "splashes from impacts",
        "puddles"
      ],
      "interaction": "Click the water to splash · drag to orbit",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "fft-ocean",
          "why": "Open sea beyond the ripples"
        },
        {
          "id": "brush-through",
          "why": "Water that parts round boats"
        },
        {
          "id": "rain-snow",
          "why": "Rain that rings the water"
        }
      ],
      "variants": [],
      "version": "1.1.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-17",
          "gpuMs": 0.703,
          "cpuMs": 0.258,
          "cpuP95Ms": 0.435,
          "badge": "moderate",
          "drawCalls": 13,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.182,
            "p99Ms": 6.915,
            "low1Fps": 141.3
          },
          "notes": null
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.638,
          "cpuMs": 0.513,
          "cpuP95Ms": 0.83,
          "badge": "moderate",
          "drawCalls": 10,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 91 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 3.9,
          "cpuMs": 0.66,
          "cpuP95Ms": 1.06,
          "badge": "heavy",
          "drawCalls": 10,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 893 ms."
        }
      ],
      "signatures": [
        {
          "file": "ripple-field.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\nimport { type WaterImpulse } from './wake-field';\ntype F = Node<'float'>;\ntype V2 = Node<'vec2'>;\nexport type RippleFieldOptions = {\n    textures?: boolean;\n};\nexport declare function needsTextures(renderer: THREE.WebGPURenderer): boolean;\nexport declare function canRenderFloat(renderer: THREE.WebGPURenderer): boolean;\nexport declare const wakeCatmullRom: THREE.TSL.FnNode<[\n    number | THREE.Node<\"float\"> | THREE.Node<\"uint\">\n], THREE.JoinNode<\"vec4\">>;\nexport declare class WaterRippleField {\n    readonly size: number;\n    readonly texel: number;\n    readonly storage: 'buffers' | 'textures';\n    static needsTextures: typeof needsTextures;\n    constructor(size: number, texel?: number, options?: RippleFieldOptions);\n    get extent(): number;\n    reachAt(p: V2): F;\n    slopeAt(p: V2): V2;\n    smoothSlopeAt(p: V2): V2;\n    update(renderer: THREE.WebGPURenderer, dt: number, focus: {\n        x: number;\n        z: number;\n    }, impulses: readonly WaterImpulse[]): void;\n    warm(renderer: THREE.WebGPURenderer): Promise<void>;\n    dispose(): void;\n}\nexport declare class WaterWakes {\n    readonly fine: WaterRippleField;\n    readonly coarse: WaterRippleField;\n    readonly size: number;\n    static needsTextures: typeof needsTextures;\n    constructor(size: number, options?: RippleFieldOptions);\n    slopeAt(p: V2): V2;\n    surfaceSlopeAt(p: V2): V2;\n    update(renderer: THREE.WebGPURenderer, dt: number, focus: {\n        x: number;\n        z: number;\n    }, impulses: readonly WaterImpulse[]): void;\n    warm(renderer: THREE.WebGPURenderer): Promise<void>;\n    dispose(): void;\n}\nexport {};"
        },
        {
          "file": "water-surface.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node } from 'three/webgpu';\nimport type { WaterWakes } from './ripple-field';\ntype F = Node<'float'>;\ntype V2 = Node<'vec2'>;\nexport type WaterLook = {\n    shallow: THREE.ColorRepresentation;\n    deep: THREE.ColorRepresentation;\n    absorption: number;\n    reflect: number;\n    caustics: number;\n    tint: number;\n};\nexport declare const WATER_LOOKS: {\n    pool: {\n        shallow: string;\n        deep: string;\n        absorption: number;\n        reflect: number;\n        caustics: number;\n        tint: number;\n    };\n    lagoon: {\n        shallow: string;\n        deep: string;\n        absorption: number;\n        reflect: number;\n        caustics: number;\n        tint: number;\n    };\n    glades: {\n        shallow: string;\n        deep: string;\n        absorption: number;\n        reflect: number;\n        caustics: number;\n        tint: number;\n    };\n};\nexport declare class WaterSurface {\n    readonly material: THREE.MeshBasicNodeMaterial;\n    readonly shallow: THREE.UniformNode<\"color\", THREE.Color>;\n    readonly deep: THREE.UniformNode<\"color\", THREE.Color>;\n    readonly absorption: THREE.UniformNode<\"float\", number>;\n    readonly reflectance: THREE.UniformNode<\"float\", number>;\n    readonly causticStrength: THREE.UniformNode<\"float\", number>;\n    readonly tint: THREE.UniformNode<\"float\", number>;\n    readonly sun: THREE.UniformNode<\"vec3\", THREE.Vector3>;\n    readonly sunColour: THREE.UniformNode<\"color\", THREE.Color>;\n    readonly horizon: THREE.UniformNode<\"color\", THREE.Color>;\n    readonly zenith: THREE.UniformNode<\"color\", THREE.Color>;\n    readonly slopeScale: THREE.UniformNode<\"float\", number>;\n    readonly wind: THREE.UniformNode<\"float\", number>;\n    readonly time: THREE.UniformNode<\"float\", number>;\n    constructor(wakes: WaterWakes | null, depthAt: (xz: V2) => F, look?: WaterLook);\n    setLook(look: WaterLook): void;\n    update(dt: number): void;\n}\nexport {};"
        }
      ],
      "pitfalls": [
        "A render-target step flips rows under WebGPU and mirrors every wake",
        "Without WebGPU (three’s WebGL2 backend: no compute)",
        "A four-cell smoothstep read terraces the rings (flat at every cell centre)",
        "Without an absorbing edge, waves bounce back off the field’s square border",
        "Nine-cell neighbourhood, not five",
        "The step runs at a fixed 30 Hz and the shader eases between the last two slopes",
        "The surface reads the frame drawn so far (viewportSharedTexture)",
        "three r187: a shared frame copy (viewportSharedTexture) can be created 8-bit before the…"
      ],
      "card": "entries/water-ripples.json"
    },
    {
      "id": "wear-grime",
      "aliases": [],
      "name": "Wear and grime",
      "summary": "Paint that wears through on edges and corners, dirt and rust that gather in crevices, and grime the world leaves: mud that climbs from the ground, splats, dust and soot, washed down by rain. Each mesh’s edges and crevices are baked once into its vertices, from the welded surface’s curvature and from rays marched through a voxel copy of it; the wear itself is four numbers a thing, driven by one age you can play over time and by the weather. A hundred worn things draw with one material: each has a slot in one storage buffer that the shared material reads as the mesh draws, so nothing is cloned and no pipeline is added. Triplanar noise read on the model at rest keeps the wear on a moving or bending part.",
      "category": "surface",
      "role": "hero-visual",
      "stack": [
        "three"
      ],
      "character": "calm",
      "tags": [
        "wear",
        "edge wear",
        "chipped paint",
        "grime",
        "dirt",
        "rust",
        "mud",
        "weathering",
        "curvature",
        "ambient occlusion",
        "cavity",
        "vertex bake",
        "voxels",
        "rays",
        "triplanar",
        "storage buffer",
        "one material",
        "slots",
        "rain",
        "wet",
        "ageing",
        "tsl",
        "no dependencies"
      ],
      "useCases": [
        "vehicles, props and machines that look used, and get more used as play goes on",
        "a level whose things age with its story: new at the start, worn by the end",
        "characters whose clothes take mud from the ground and lose it in the rain",
        "many worn things on screen at once without a material each",
        "checking where a model’s edges and crevices are before texturing it",
        "a quick weathered look for generated or kitbashed models that have no hand-painted textures"
      ],
      "interaction": "Click a thing to throw mud at it · drag to orbit · the card picks a thing for the keyboard",
      "kits": [],
      "pairsWith": [
        {
          "id": "mesh-dents",
          "why": "Dents beside the wear"
        },
        {
          "id": "rain-snow",
          "why": "Rain that washes the grime down"
        },
        {
          "id": "material-designer",
          "why": "The materials that wear"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "mixed",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 1.202,
          "cpuMs": 0.433,
          "cpuP95Ms": 1.28,
          "badge": "moderate",
          "drawCalls": 11,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.887,
            "p99Ms": 7.895,
            "low1Fps": 118.7
          },
          "notes": "Measured with four things (2,600 to 13,000 vertices each) drawn by two taught materials from one wear bank, ageing by itself in a 30 s loop and the figure walking through the puddle (grime stepped ten times a second, packed and uploaded); a 2048² key-light shadow map and a room environment. Each lit pixel reads the triplanar wear noise six times."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 6.554,
          "cpuMs": 0.995,
          "cpuP95Ms": 1.475,
          "badge": "heavy",
          "drawCalls": 11,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 1371 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 4.847,
          "cpuMs": 0.52,
          "cpuP95Ms": 0.72,
          "badge": "heavy",
          "drawCalls": 11,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 1930 ms."
        }
      ],
      "signatures": [
        {
          "file": "bake-geometry.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport { type BakeOptions, type WearBake } from './bake';\nexport declare function bakeGeometry(geometry: THREE.BufferGeometry, options?: Partial<BakeOptions>): WearBake;\nexport declare function unbaked(geometry: THREE.BufferGeometry): void;"
        },
        {
          "file": "grime.ts",
          "declarations": "export declare const GRIME: {\n    readonly knee: 0.55;\n    readonly hip: 0.95;\n    readonly ashTop: 0.35;\n    readonly ashRise: 0.035;\n    readonly gait: Record<\"walk\" | \"run\" | \"sneak\", number>;\n    readonly splats: 4;\n    readonly join: 0.12;\n    readonly radius: 0.06;\n    readonly radiusPerAmount: 0.1;\n    readonly widest: 0.3;\n    readonly dustLasts: 360;\n    readonly sootLasts: 900;\n    readonly flakeLasts: 1800;\n    readonly dries: 120;\n    readonly puffReach: 4;\n    readonly wade: 0.2;\n    readonly deep: 0.9;\n    readonly wadeWash: 0.12;\n};\nexport type GrimeTuning = {\n    mudRise: number;\n    splatLasts: number;\n    rainWash: number;\n};\nexport declare const GRIME_TUNING: GrimeTuning;\nexport declare const GRIME_KNOBS: Record<keyof GrimeTuning, {\n    label: string;\n    min: number;\n    max: number;\n    step: number;\n    recommended: number;\n    hint: string;\n}>;\nexport type GrimeSplat = {\n    x: number;\n    y: number;\n    z: number;\n    radius: number;\n    amount: number;\n};\nexport type Grime = {\n    mud: number;\n    mudWet: number;\n    mudColour: [\n        number,\n        number,\n        number\n    ];\n    ash: number;\n    dust: number;\n    soot: number;\n    splats: GrimeSplat[];\n};\nexport declare const MUD_COLOUR: [\n    number,\n    number,\n    number\n];\nexport declare function cleanGrime(): Grime;\nexport declare function grimy(g: Grime): boolean;\nexport type GroundLayer = {\n    id: string;\n    surfaceType?: string;\n    weight: number;\n};\nexport declare function muddiness(layers: readonly GroundLayer[], wet: number): number;\nexport declare function muddyLiquid(materialId: string): boolean;\nexport type GrimeStep = {\n    dt: number;\n    moved: number;\n    gait: 'walk' | 'run' | 'sneak';\n    mud: number;\n    mudColour?: readonly [\n        number,\n        number,\n        number\n    ] | null;\n    puddle: number;\n    char: number;\n    liquid: {\n        depth: number;\n        muddy: boolean;\n        colour?: readonly [\n            number,\n            number,\n            number\n        ] | null;\n    } | null;\n    rain: number;\n};\nexport declare function stepGrime(g: Grime, s: GrimeStep, tuning?: GrimeTuning): Grime;\nexport declare function addSplat(g: Grime, at: {\n    x: number;\n    y: number;\n    z: number;\n}, amount: number): Grime;\nexport declare function addPuff(g: Grime, distance: number, radius: number, heat?: number): Grime;\nexport type BodyFrame = {\n    feet: number;\n    unit: number;\n};\nexport declare const METRE_FRAME: BodyFrame;\nexport declare const GRIME_FLOATS = 32;\nexport declare function packGrime(g: Grime, out: Float32Array, offset?: number, frame?: BodyFrame): Float32Array<ArrayBufferLike>;"
        },
        {
          "file": "wear-bank.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { StorageBufferNode } from 'three/webgpu';\nimport { type Wear } from './wear';\nexport declare const WEAR_SLOTS = 256;\nexport interface SlotLook {\n    scale?: number;\n    dirtColor?: THREE.ColorRepresentation;\n    underColor?: THREE.ColorRepresentation;\n    underMetal?: number;\n}\nexport declare const WEAR_VIEWS: readonly [\n    \"final\",\n    \"edges\",\n    \"cavities\",\n    \"masks\"\n];\nexport type WearView = (typeof WEAR_VIEWS)[number];\nexport type WearBankOptions = {\n    textures?: boolean;\n};\nexport declare class WearBank {\n    readonly buffer: StorageBufferNode<'vec4'> | null;\n    readonly texture: THREE.DataTexture | null;\n    readonly view: THREE.UniformNode<\"int\", number>;\n    readonly noise: THREE.DataTexture;\n    static needsTextures(renderer: THREE.WebGPURenderer): boolean;\n    constructor(options?: WearBankOptions);\n    acquire(id: string, look?: SlotLook, onlyKnown?: boolean): number | null;\n    release(id: string): void;\n    setLook(slot: number, look: SlotLook): void;\n    set(slot: number, wear: Partial<Wear>): void;\n    get(slot: number): Wear;\n    setGrime(slot: number, packed: Float32Array): void;\n    grime(slot: number): Float32Array<ArrayBuffer>;\n    tintDirt(slot: number, colour: THREE.Color, rate?: number): void;\n    assign(root: THREE.Object3D, slot: number | null): void;\n    apply(material: THREE.Material, { multiplied, grime }?: {\n        multiplied?: boolean;\n        grime?: boolean;\n    }): void;\n    dispose(): void;\n}"
        },
        {
          "file": "wear.ts",
          "declarations": "export interface Wear {\n    chips: number;\n    dirt: number;\n    rust: number;\n    wet: number;\n}\nexport declare const NO_WEAR: Wear;\nexport interface AgeCurve {\n    chips: [\n        from: number,\n        to: number,\n        most: number\n    ];\n    dirt: [\n        from: number,\n        to: number,\n        most: number\n    ];\n    rust: [\n        from: number,\n        to: number,\n        most: number\n    ];\n}\nexport declare const AGE_CURVE: AgeCurve;\nexport declare function ageWear(age: number, now?: Wear, curve?: AgeCurve): Wear;\nexport declare const RAIN_ON_THINGS: {\n    readonly soak: 0.06;\n    readonly rinse: 0.003;\n    readonly dries: 120;\n};\nexport declare function weather(w: Wear, dt: number, rain: number, water?: number | null): Wear;"
        }
      ],
      "pitfalls": [
        "The bake lives in the vertices, so a mesh needs vertices where the wear goes",
        "Weld before measuring",
        "Fill the voxel copy solid before marching rays through it",
        "Start each ray about one and a half voxels off the surface",
        "Every mesh drawn with a taught material needs the `wear` attribute",
        "Read the wear on the model at rest (`positionGeometry`, `normalGeometry`)",
        "Vertex colours multiply after a node material’s colour",
        "Write wear into the slot, never into the material",
        "Without WebGPU, make the bank with `textures: WearBank.needsTextures(renderer)`",
        "Bake once, when the mesh is made or loaded (tens of milliseconds for ten thousand vertices)"
      ],
      "card": "entries/wear-grime.json"
    },
    {
      "id": "weight-glyphs",
      "aliases": [],
      "name": "Weight glyphs: type that carries the data",
      "summary": "One distance-field atlas holds a thin and a black cut of a typeface in its red and green channels, every glyph in the same fixed cell, so mixing the channels gives any weight in between and mixing two cells melts one character into another. Elements marked data-wg keep their words in the page, read aloud, selectable and laid out by CSS, while one instanced WebGPU draw paints them: set data-wg-w and the weight springs there, change the text and it melts character by character, hold a lens over it and the letters near the pointer swell and push their neighbours along. Canvas 2D paints the same where WebGPU is missing; forced colours and a lost device fall back to the DOM, which keeps the data’s weight too. The demo is a year whose every date is as heavy as its day is booked.",
      "category": "ui",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "balanced",
      "tags": [
        "typography",
        "variable font",
        "font weight",
        "sdf",
        "msdf atlas",
        "distance field",
        "text morph",
        "melt",
        "raw webgpu",
        "wgsl",
        "instancing",
        "canvas 2d",
        "dom + gpu",
        "data visualisation",
        "calendar",
        "heat map",
        "springs",
        "accessibility",
        "reduced motion",
        "forced colours",
        "no dependencies"
      ],
      "useCases": [
        "calendars and timetables where each date weighs as much as the day holds",
        "tables and dashboards whose numbers carry their size or urgency in their weight",
        "headlines and hero type that melt into new words and swell under the pointer",
        "counters and scores whose digits morph instead of flipping",
        "any GPU-painted text that must stay real, selectable, searchable text for screen readers"
      ],
      "interaction": "Point at the headline to weigh it, click for the next · change the team and the year re-weighs · arrow through the days",
      "kits": [
        {
          "kit": "dashboard",
          "as": "optional"
        }
      ],
      "pairsWith": [
        {
          "id": "data-table",
          "why": "Dense columns that carry values in weight"
        },
        {
          "id": "sdf-text",
          "why": "Distance-field text at any zoom"
        },
        {
          "id": "chart-access",
          "why": "The values as a table"
        }
      ],
      "variants": [],
      "version": "1.0.1",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu",
        "gpu": "webgpu",
        "drivenBy": "mixed",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [
        {
          "name": "motion",
          "in": "module",
          "values": {
            "strict": "reduced",
            "refined": "auto",
            "playful": "full"
          },
          "note": "reduced: weight changes happen at once"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 0.14,
          "cpuMs": 0.65,
          "cpuP95Ms": 1.365,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.685,
            "p99Ms": 18.02,
            "low1Fps": 52.2
          },
          "notes": "Measured with the demo running itself from its first frame: the team changes every 0.8 s (every day’s numeral, the month names and the weekday heads sweep to new weights across the year), the headline melts into its next line every 1.6 s, and a weight lens slides along it. About 500 marked elements, some 700 glyphs in one instanced draw. The overlay is driven from the demo’s update(), so CPU time is its frame (springs, placement, the batch) and GPU time its pass, from timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.197,
          "cpuMs": 0.94,
          "cpuP95Ms": 1.84,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.68,
            "p99Ms": 18.1,
            "low1Fps": 48
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 364 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 4.027,
          "cpuMs": 1.62,
          "cpuP95Ms": 2.16,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 428 ms."
        }
      ],
      "signatures": [
        {
          "file": "atlas.ts",
          "declarations": "import type { GlyphMetrics } from './core';\nexport type AtlasSpec = {\n    raster: number;\n    cell: number;\n    base: number;\n    spread: number;\n    cols: number;\n};\nexport declare const DEFAULT_SPEC: AtlasSpec;\nexport declare const LATIN: string;\nexport type Rasteriser = {\n    draw(ch: string, cut: 0 | 1): Uint8Array;\n    measure(text: string, cut: 0 | 1): number;\n    ascent: number;\n    descent: number;\n};\nexport type WeightAtlas = GlyphMetrics & {\n    readonly data: Uint8Array;\n    readonly width: number;\n    readonly height: number;\n    readonly spec: AtlasSpec;\n    readonly family: string;\n    readonly cuts: readonly [\n        number,\n        number\n    ];\n    readonly ascent: number;\n    readonly descent: number;\n    readonly fallback: boolean;\n    glyph(ch: string): number;\n    char(glyph: number): string;\n    has(ch: string): boolean;\n    cssWeight(w: number): number;\n};\nexport declare const cellOrigin: (glyph: number, spec: AtlasSpec) => [\n    number,\n    number\n];\nexport declare function atlasSize(count: number, spec: AtlasSpec): {\n    width: number;\n    height: number;\n};\nexport declare function buildAtlas(chars: string, spec: AtlasSpec, raster: Rasteriser, meta: {\n    family: string;\n    cuts: [\n        number,\n        number\n    ];\n    fallback?: boolean;\n}): Generator<number, WeightAtlas, void>;\nexport declare function packAtlas(chars: string, spec: AtlasSpec, raster: Rasteriser, meta: {\n    family: string;\n    cuts: [\n        number,\n        number\n    ];\n    fallback?: boolean;\n}): WeightAtlas;\nexport declare function canvasRasteriser(family: string, cuts: [\n    number,\n    number\n], spec: AtlasSpec): Rasteriser;\nexport type WeightAtlasOptions = {\n    family?: string;\n    cuts?: [\n        number,\n        number\n    ];\n    chars?: string;\n    spec?: Partial<AtlasSpec>;\n    slice?: number;\n};\nexport declare function createWeightAtlas(options?: WeightAtlasOptions): Promise<WeightAtlas>;"
        },
        {
          "file": "core.ts",
          "declarations": "export type Spring = {\n    v: number;\n    to: number;\n    vel: number;\n    k: number;\n    c: number;\n};\nexport declare function spring(v?: number, k?: number, c?: number): Spring;\nexport declare const atRest: (s: Spring) => boolean;\nexport declare function snap(s: Spring, x?: number): void;\nexport declare function stepSpring(s: Spring, dt: number): boolean;\nexport declare const safeDt: (dt: number) => number;\nexport declare const clamp01: (v: number) => number;\nexport declare const weightFromCss: (css: number, thin?: number, black?: number) => number;\nexport declare const cssFromWeight: (w: number, thin?: number, black?: number) => number;\nexport type WeightScale = {\n    min?: number;\n    max?: number;\n    from?: number;\n    to?: number;\n    gamma?: number;\n};\nexport declare function weightOfValue(value: number, scale?: WeightScale): number;\nexport interface GlyphMetrics {\n    advance(ch: string, w: number): number;\n    kern(a: string, b: string, w: number): number;\n}\nexport type Slot = {\n    a: string;\n    b: string;\n    m: Spring;\n    md: number;\n    w: Spring;\n    wd: number;\n};\nexport declare const shown: (s: Slot) => string;\nexport type MeltOptions = {\n    weight: number;\n    instant?: boolean;\n    stagger?: number;\n    fromEnd?: boolean;\n    melt?: {\n        k: number;\n        c: number;\n    };\n    weightSpring?: {\n        k: number;\n        c: number;\n    };\n};\nexport declare function retext(prev: Slot[], next: string, o: MeltOptions): Slot[];\nexport declare function prune(slots: Slot[]): Slot[];\nexport declare function stepSlots(slots: Slot[], dt: number): boolean;\nexport declare function retarget(slots: Slot[], weight: number, delay?: (i: number) => number, instant?: boolean): void;\nexport declare function normaliseText(text: string, pre: boolean): string;\nexport declare function slotAdvance(s: Slot, metrics: GlyphMetrics): number;\nexport type Placement = {\n    xs: Float32Array;\n    width: number;\n};\nexport declare function place(slots: Slot[], metrics: GlyphMetrics, size: number, letterSpacing?: number, out?: Float32Array): Placement;\nexport declare const runStart: (align: \"left\" | \"right\" | \"center\", anchor: number, width: number) => number;\nexport type Lens = {\n    x: number;\n    radius: number;\n    weight: number;\n    strength?: number;\n};\nexport declare function lensed(base: number, lens: Lens | null, cx: number): number;\nexport type Rgba = [\n    number,\n    number,\n    number,\n    number\n];\nexport declare function parseColour(css: string): Rgba | null;"
        },
        {
          "file": "weight-glyphs.ts",
          "declarations": "import type { WeightAtlas } from './atlas';\nimport { type GlyphBatch } from './batch';\nexport type PaintChoice = 'auto' | 'webgpu' | 'canvas' | 'dom';\nexport type PaintMode = 'webgpu' | 'canvas' | 'dom';\nexport type MotionChoice = 'auto' | 'full' | 'reduced';\nexport type PointerLens = {\n    clientX: number;\n    radius: number;\n    weight: number;\n    strength?: number;\n};\nexport type WeightGlyphsOptions = {\n    host: HTMLElement;\n    atlas: WeightAtlas;\n    selector?: string;\n    paint?: PaintChoice;\n    motion?: MotionChoice;\n    loop?: boolean;\n    stagger?: number;\n    maxDpr?: number;\n    device?: GPUDevice;\n    zIndex?: number;\n    draw?: (batch: GlyphBatch, wg: WeightGlyphs) => void;\n    onMode?: (mode: PaintMode, why: string) => void;\n};\nexport type HostRect = {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n};\nexport type WeightGlyphs = {\n    readonly mode: PaintMode;\n    weigh(el: HTMLElement, weight: number, delay?: number): void;\n    lens(el: HTMLElement, lens: PointerLens | null): void;\n    weightOf(el: HTMLElement): number | null;\n    rectOf(el: HTMLElement): HostRect | null;\n    scan(): void;\n    refresh(el: HTMLElement): void;\n    restyle(): void;\n    relayout(): void;\n    invalidate(): void;\n    settle(): void;\n    frame(dt: number): boolean;\n    set(options: {\n        paint?: PaintChoice;\n        motion?: MotionChoice;\n        stagger?: number;\n    }): Promise<void>;\n    gpuTime(): number | null;\n    dispose(): void;\n};\nexport declare function createWeightGlyphs(options: WeightGlyphsOptions): Promise<WeightGlyphs>;"
        }
      ],
      "pitfalls": [
        "Mixing a thin and a black field is an approximation of the weights between",
        "Load the font before the atlas (createWeightAtlas waits for both cuts)",
        "Canvas 2D cannot switch on OpenType features, so the atlas holds the default glyphs and widths",
        "A marked element is one line (white-space: pre, display: inline-block)",
        "The DOM box keeps the element’s data weight (data-wg-w sets font-weight through --wg-fw)",
        "Colours, sizes and rectangles are read when something changes",
        "The canvas covers the host and does not scroll with it",
        "Transformed elements (scale, rotate) are painted at their computed font size in their bounding…",
        "The text fill is transparent only once the first frame is painted (the host gets .wg-on)"
      ],
      "card": "entries/weight-glyphs.json"
    },
    {
      "id": "wildfire",
      "aliases": [],
      "name": "Wildfire on a seeded fire map",
      "summary": "A wildfire run as pure, seeded rules a server can run as they are: 8 m blocks of grass, scrub and woods over a 1 m raster of roads and water, stepped a minute at a time. The wind drives a long elliptical head, slopes speed it uphill, night and rain slow it, woods crown in strong wind and burning blocks throw embers across lanes but not rivers. A log of what people did (breaks, douses, backburns, new fires) applies as its minute comes, and snapshots restore exactly, so the same start, weather and log give the same fire on any machine. With a fire-danger rating and a fuel builder.",
      "category": "simulation",
      "role": "system",
      "stack": [
        "headless"
      ],
      "character": "calm",
      "tags": [
        "wildfire",
        "fire spread",
        "cellular automaton",
        "deterministic",
        "seeded",
        "lockstep",
        "server",
        "replay",
        "snapshot",
        "wind",
        "slope",
        "embers",
        "spotting",
        "crown fire",
        "firebreak",
        "fire danger",
        "game simulation",
        "canvas 2d",
        "no dependencies"
      ],
      "useCases": [
        "a wildfire event in an open-world or strategy game",
        "a fire a server runs and every client draws the same",
        "replays and save games of a spreading hazard",
        "a firefighting or land-management game where breaks must hold",
        "a teaching model of how wind, fuel and slope steer a fire",
        "any spreading front on a grid (blight, flood of influence) that must be deterministic"
      ],
      "interaction": "Drag across the fire’s path to scrape a break · 1–4 pick a tool · turn the wind dial · Space pauses",
      "kits": [],
      "pairsWith": [
        {
          "id": "plants-burn",
          "why": "Plants that burn where the map says"
        },
        {
          "id": "heightfield-chunks",
          "why": "The slopes the fire runs up"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "canvas2d",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.52",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-13",
          "gpuMs": null,
          "cpuMs": 0.797,
          "cpuP95Ms": 5.345,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with a fire lit upwind in a strong breeze at 30 minutes a second, a break laid across its path, embers and smoke on; it is cleared and lit again when it goes out. The time includes stepping the fire map (about 13,500 blocks), redrawing its layer where it burns, and the Canvas 2D drawing. Paused or out, nothing is drawn."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": null,
          "cpuMs": 1.41,
          "cpuP95Ms": 6.015,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 180 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": null,
          "cpuMs": 1.44,
          "cpuP95Ms": 11.08,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 290 ms."
        }
      ],
      "signatures": [
        {
          "file": "fuel.ts",
          "declarations": "import { type FuelGrid } from './wildfire';\nexport type Cover = {\n    fuel: number;\n    scrub: number;\n    grass: number;\n    trees: number;\n    bushes: number;\n};\nexport declare const PLAIN_COVER: Cover;\ntype P = {\n    x: number;\n    z: number;\n};\nexport type FuelInput = {\n    minX: number;\n    minZ: number;\n    maxX: number;\n    maxZ: number;\n    coverAt(x: number, z: number): Cover | null;\n    plants?: ReadonlyArray<P & {\n        kind: 'tree' | 'bush';\n    }>;\n    roads?: ReadonlyArray<{\n        points: readonly P[];\n        halfWidth: number;\n    }>;\n    rivers?: ReadonlyArray<{\n        points: ReadonlyArray<P & {\n            width: number;\n        }>;\n        bare?: boolean;\n    }>;\n    lakes?: ReadonlyArray<{\n        outline: readonly P[];\n        bare?: boolean;\n    }>;\n    buildings?: ReadonlyArray<readonly P[]>;\n    heightAt?(x: number, z: number): number;\n    scarred?(x: number, z: number): boolean;\n    seed?: number;\n    revision?: string;\n};\nexport declare const FOREST_TREES = 2;\nexport declare function fireFuel(input: FuelInput): FuelGrid;\nexport type FuelGridData = {\n    x0: number;\n    z0: number;\n    cols: number;\n    rows: number;\n    revision: string;\n    load: string;\n    kind: string;\n    trees: string;\n    height: string;\n    ground: string;\n};\nexport declare function encodeFuel(fuel: FuelGrid): FuelGridData;\nexport declare function decodeFuel(data: FuelGridData): FuelGrid;\nexport {};"
        },
        {
          "file": "wildfire.ts",
          "declarations": "export declare const BLOCK = 8;\nexport declare const GROUND_CELL = 1;\nexport declare const GROUND_PER: number;\nexport declare const FUEL: {\n    readonly bare: 0;\n    readonly grass: 1;\n    readonly scrub: 2;\n    readonly forest: 3;\n    readonly water: 4;\n};\nexport type FuelKind = (typeof FUEL)[keyof typeof FUEL];\nexport declare const GROUND: {\n    readonly fuel: 0;\n    readonly bare: 1;\n    readonly water: 2;\n};\nexport declare const WIND_WAY: {\n    readonly x: number;\n    readonly z: number;\n};\nexport declare const WILDFIRE_MAP_KNOBS: {\n    readonly minuteSeconds: {\n        readonly label: \"A step lasts\";\n        readonly min: 1;\n        readonly max: 60;\n        readonly step: 1;\n        readonly recommended: 2;\n        readonly unit: \"s\";\n        readonly hint: \"Real seconds one step (a minute of the fire's clock) stands for: the speeds below are real m/s. The source game ran a game minute in 2 s; 60 runs in real time.\";\n    };\n    readonly grassCalm: {\n        readonly label: \"Grass: calm\";\n        readonly min: 0.05;\n        readonly max: 1;\n        readonly step: 0.05;\n        readonly recommended: 0.3;\n        readonly unit: \"m/s\";\n        readonly hint: \"How fast a fire runs through short grass and meadow in still air: 0.3 makes about 36 m an hour of 2 s minutes.\";\n    };\n    readonly grassGale: {\n        readonly label: \"Grass: gale, downwind\";\n        readonly min: 0.3;\n        readonly max: 4;\n        readonly step: 0.1;\n        readonly recommended: 1.5;\n        readonly unit: \"m/s\";\n        readonly hint: \"How fast its head runs downwind in a gale: 1.5 makes about 180 m an hour, no faster than a jog.\";\n    };\n    readonly scrubCalm: {\n        readonly label: \"Scrub: calm\";\n        readonly min: 0.05;\n        readonly max: 1;\n        readonly step: 0.05;\n        readonly recommended: 0.2;\n        readonly unit: \"m/s\";\n        readonly hint: \"Dry scrub and steppe in still air: slower to get going than grass, but it burns longer.\";\n    };\n    readonly scrubGale: {\n        readonly label: \"Scrub: gale, downwind\";\n        readonly min: 0.3;\n        readonly max: 4;\n        readonly step: 0.1;\n        readonly recommended: 1.2;\n        readonly unit: \"m/s\";\n        readonly hint: \"Dry scrub and steppe downwind in a gale.\";\n    };\n    readonly forestCalm: {\n        readonly label: \"Forest floor: calm\";\n        readonly min: 0.01;\n        readonly max: 0.5;\n        readonly step: 0.01;\n        readonly recommended: 0.05;\n        readonly unit: \"m/s\";\n        readonly hint: \"A forest floor burning in still air: a slow creep through the litter, about 6 m an hour.\";\n    };\n    readonly forestGale: {\n        readonly label: \"Forest floor: gale, downwind\";\n        readonly min: 0.1;\n        readonly max: 2;\n        readonly step: 0.05;\n        readonly recommended: 0.4;\n        readonly unit: \"m/s\";\n        readonly hint: \"A forest floor downwind in a gale (unless it crowns).\";\n    };\n    readonly crownGale: {\n        readonly label: \"Crown: gale, downwind\";\n        readonly min: 0.5;\n        readonly max: 5;\n        readonly step: 0.1;\n        readonly recommended: 2.5;\n        readonly unit: \"m/s\";\n        readonly hint: \"A crown fire running tree top to tree top downwind: about 300 m an hour in a gale.\";\n    };\n    readonly grassBurn: {\n        readonly label: \"Grass burns for\";\n        readonly min: 0.5;\n        readonly max: 10;\n        readonly step: 0.5;\n        readonly recommended: 1;\n        readonly unit: \"min\";\n        readonly hint: \"How long flames stand at a point of grass (the block burns on while its front crosses it).\";\n    };\n    readonly scrubBurn: {\n        readonly label: \"Scrub burns for\";\n        readonly min: 0.5;\n        readonly max: 20;\n        readonly step: 0.5;\n        readonly recommended: 3;\n        readonly unit: \"min\";\n        readonly hint: \"How long flames stand at a point of scrub.\";\n    };\n    readonly forestBurn: {\n        readonly label: \"Forest floor burns for\";\n        readonly min: 1;\n        readonly max: 60;\n        readonly step: 1;\n        readonly recommended: 10;\n        readonly unit: \"min\";\n        readonly hint: \"How long flames stand at a point of forest floor.\";\n    };\n    readonly crownBurn: {\n        readonly label: \"Crown burns for\";\n        readonly min: 1;\n        readonly max: 30;\n        readonly step: 1;\n        readonly recommended: 5;\n        readonly unit: \"min\";\n        readonly hint: \"How long a crown burns in a block before it is snags (the floor burns on under it).\";\n    };\n    readonly linger: {\n        readonly label: \"Block lingers\";\n        readonly min: 1;\n        readonly max: 4;\n        readonly step: 0.1;\n        readonly recommended: 1.5;\n        readonly hint: \"A burning block burns this many times as long as a calm fire takes to cross it (plus its flames): long enough that a still night slows a fire without putting it out.\";\n    };\n    readonly calmWind: {\n        readonly label: \"Wind: calm at\";\n        readonly min: 0;\n        readonly max: 2;\n        readonly step: 0.05;\n        readonly recommended: 0.9;\n        readonly hint: \"The wind on the ground (about 0.9 an ordinary day) at or under which a fire runs at its calm speed every way.\";\n    };\n    readonly galeWind: {\n        readonly label: \"Wind: gale at\";\n        readonly min: 1.5;\n        readonly max: 6;\n        readonly step: 0.1;\n        readonly recommended: 3;\n        readonly hint: \"The wind on the ground at which a fire's head runs at its gale speed (it may run a little faster in more).\";\n    };\n    readonly breeze: {\n        readonly label: \"Spotting from\";\n        readonly min: 0.5;\n        readonly max: 3;\n        readonly step: 0.05;\n        readonly recommended: 1.2;\n        readonly hint: \"Wind on the ground over which burning blocks throw embers downwind.\";\n    };\n    readonly crownWind: {\n        readonly label: \"Crowns from\";\n        readonly min: 1;\n        readonly max: 5;\n        readonly step: 0.1;\n        readonly recommended: 1.8;\n        readonly hint: \"Wind on the ground from which a forest block catching from upwind may crown (a calm forest burns along the floor).\";\n    };\n    readonly uphill: {\n        readonly label: \"Uphill at 20 degrees\";\n        readonly min: 1;\n        readonly max: 4;\n        readonly step: 0.1;\n        readonly recommended: 2;\n        readonly hint: \"How many times faster a fire runs up a 20 degree slope (half as much again slower down one).\";\n    };\n    readonly night: {\n        readonly label: \"At night\";\n        readonly min: 0.1;\n        readonly max: 1;\n        readonly step: 0.05;\n        readonly recommended: 0.5;\n        readonly hint: \"The share of its speed a fire keeps at night (damper air): 0.5 halves it from 22:00 to 05:00, easing in and out.\";\n    };\n    readonly dryStep: {\n        readonly label: \"Each dry day past two\";\n        readonly min: 0;\n        readonly max: 0.3;\n        readonly step: 0.02;\n        readonly recommended: 0.1;\n        readonly hint: \"Each dry day past two (no shower or storm) makes it this much faster.\";\n    };\n    readonly dryMost: {\n        readonly label: \"Dry days add at most\";\n        readonly min: 0;\n        readonly max: 1;\n        readonly step: 0.05;\n        readonly recommended: 0.5;\n        readonly hint: \"The most the dry days add (0.5: half again as fast).\";\n    };\n    readonly rainDouse: {\n        readonly label: \"Rain puts it out from\";\n        readonly min: 0.1;\n        readonly max: 1;\n        readonly step: 0.05;\n        readonly recommended: 0.4;\n        readonly hint: \"Rain heavier than this (0-1) burns blocks down fast: a downpour puts a front out within minutes. Any rain damps the spread by its share.\";\n    };\n    readonly hold: {\n        readonly label: \"A gap holds at\";\n        readonly min: 0.5;\n        readonly max: 8;\n        readonly step: 0.25;\n        readonly recommended: 2.5;\n        readonly unit: \"m\";\n        readonly hint: \"Bare metres between two blocks (a road, a stream) that a spreading fire cannot cross; narrower gaps slow it. Only embers jump a road.\";\n    };\n    readonly grassSpot: {\n        readonly label: \"Grass embers reach\";\n        readonly min: 2;\n        readonly max: 30;\n        readonly step: 0.5;\n        readonly recommended: 9;\n        readonly unit: \"m\";\n        readonly hint: \"How far a burning block of grass or scrub throws an ember downwind in a gale: past a 6 m lane, not across a 9.5 m road.\";\n    };\n    readonly forestSpot: {\n        readonly label: \"Forest embers reach\";\n        readonly min: 8;\n        readonly max: 80;\n        readonly step: 1;\n        readonly recommended: 30;\n        readonly unit: \"m\";\n        readonly hint: \"How far a burning forest floor throws an ember downwind.\";\n    };\n    readonly crownSpot: {\n        readonly label: \"Crown embers reach\";\n        readonly min: 8;\n        readonly max: 120;\n        readonly step: 1;\n        readonly recommended: 50;\n        readonly unit: \"m\";\n        readonly hint: \"How far a crown fire throws an ember downwind: across any road.\";\n    };\n    readonly grassSpotChance: {\n        readonly label: \"Grass embers a minute\";\n        readonly min: 0;\n        readonly max: 0.5;\n        readonly step: 0.01;\n        readonly recommended: 0.08;\n        readonly hint: \"A burning grass or scrub block's chance a minute to throw an ember, in a gale (less in less wind, none under a breeze).\";\n    };\n    readonly forestSpotChance: {\n        readonly label: \"Forest embers a minute\";\n        readonly min: 0;\n        readonly max: 0.5;\n        readonly step: 0.01;\n        readonly recommended: 0.05;\n        readonly hint: \"A burning forest floor's chance a minute to throw an ember, in a gale.\";\n    };\n    readonly crownSpotChance: {\n        readonly label: \"Crown embers a minute\";\n        readonly min: 0;\n        readonly max: 1;\n        readonly step: 0.01;\n        readonly recommended: 0.3;\n        readonly hint: \"A crowning block's chance a minute to throw an ember, in a gale.\";\n    };\n    readonly waterHold: {\n        readonly label: \"Water embers cannot cross\";\n        readonly min: 2;\n        readonly max: 60;\n        readonly step: 1;\n        readonly recommended: 12;\n        readonly unit: \"m\";\n        readonly hint: \"An ember that would cross more water than this dies on the way: rivers hold better than roads.\";\n    };\n    readonly least: {\n        readonly label: \"Least fuel\";\n        readonly min: 0.02;\n        readonly max: 0.5;\n        readonly step: 0.01;\n        readonly recommended: 0.12;\n        readonly hint: \"A block with less fuel than this does not burn (bare rock, a yard, a scraped break).\";\n    };\n    readonly wetFor: {\n        readonly label: \"A wet line lasts\";\n        readonly min: 5;\n        readonly max: 240;\n        readonly step: 5;\n        readonly recommended: 60;\n        readonly unit: \"min\";\n        readonly hint: \"How long a doused block that was not burning resists catching.\";\n    };\n};\nexport type WildfireKnobs = {\n    [K in keyof typeof WILDFIRE_MAP_KNOBS]: number;\n};\nexport declare const WILDFIRE_MAP: WildfireKnobs;\nexport interface FuelGrid {\n    x0: number;\n    z0: number;\n    cols: number;\n    rows: number;\n    load: Uint8Array;\n    kind: Uint8Array;\n    trees: Uint8Array;\n    height: Float32Array;\n    ground: Uint8Array;\n    revision: string;\n}\nexport declare function groundAt(fuel: FuelGrid, x: number, z: number): number;\nexport declare function blockAt(fuel: Pick<FuelGrid, 'x0' | 'z0' | 'cols' | 'rows'>, x: number, z: number): number;\nexport declare const blockMiddle: (fuel: Pick<FuelGrid, \"x0\" | \"z0\" | \"cols\">, i: number) => {\n    x: number;\n    z: number;\n};\nexport declare function rollOf(seed: number, a: number, b: number, c: number): number;\nexport declare function seedFrom(text: string): number;\nexport type FireAir = {\n    wind: number;\n    way?: {\n        x: number;\n        z: number;\n    };\n    rain: number;\n    hour: number;\n    dry: number;\n};\nexport type FireWeather = (minute: number) => FireAir;\nexport declare function steadyWeather(air: Omit<FireAir, 'hour'>): FireWeather;\nexport declare const PHASE: {\n    readonly unburnt: 0;\n    readonly burning: 1;\n    readonly burnt: 2;\n};\nexport declare const FLAG: {\n    readonly crown: 1;\n    readonly crowned: 2;\n    readonly scraped: 4;\n    readonly backburnt: 8;\n};\nexport declare const LINE: number;\nexport type WildfireStart = {\n    seed: number;\n    x: number;\n    z: number;\n    minute: number;\n    radius: number;\n};\nexport type WildfireCommand = {\n    minute: number;\n    kind: 'douse' | 'break' | 'backburn' | 'ignite';\n    x: number;\n    z: number;\n    r: number;\n};\nexport interface WildfireState {\n    readonly fuel: FuelGrid;\n    readonly seed: number;\n    minute: number;\n    phase: Uint8Array;\n    heat: Float32Array;\n    at: Int32Array;\n    flags: Uint8Array;\n    wet: Uint16Array;\n    wetList: number[];\n    met: Uint8Array;\n    burning: number[];\n    touched: number;\n    box: {\n        c0: number;\n        r0: number;\n        c1: number;\n        r1: number;\n    } | null;\n    version: number;\n    gain: Float32Array;\n    along: Float32Array;\n}\nexport declare function burnMinutes(kind: number, k?: WildfireKnobs): number;\nexport declare function startWildfire(fuel: FuelGrid, start: WildfireStart, k?: WildfireKnobs): WildfireState;\nexport declare function nightOf(hour: number, k?: WildfireKnobs): number;\nexport declare function stepWildfire(s: WildfireState, weather: FireWeather, log: readonly WildfireCommand[], to: number, k?: WildfireKnobs): WildfireState;\nexport declare function isFront(s: WildfireState, i: number, k?: WildfireKnobs): boolean;\nexport declare function heldLines(s: WildfireState, k?: WildfireKnobs): {\n    lines: number;\n    met: number;\n    held: number[];\n    breaks: {\n        blocks: number;\n        met: number;\n        held: number[];\n    }[];\n};\nexport declare function reachOf(s: WildfireState, x: number, z: number): number;\nexport declare function fireCounts(s: WildfireState): {\n    burning: number;\n    burnt: number;\n    crowned: number;\n    area: number;\n};\nexport declare function toBase64(bytes: Uint8Array): string;\nexport declare function fromBase64(text: string): Uint8Array<ArrayBuffer>;\nexport declare function snapshotOf(s: WildfireState): string;\nexport declare function restoreWildfire(fuel: FuelGrid, seed: number, text: string): WildfireState | null;"
        }
      ],
      "pitfalls": [
        "The weather callback must be pure",
        "Determinism holds only for the same fuel grid, seed, start, weather, log and knobs",
        "A command applies at the first step at or after its minute",
        "The gaps between blocks are worked out once per grid and kept in a WeakMap on it",
        "The first step on a new grid pays for those gaps (tens of ms for 13,500 blocks)",
        "The knobs are speeds in real metres a second with a step of `minuteSeconds`",
        "A break one block wide holds at any angle only because fire never takes a diagonal or knight’s…",
        "Embers jump roads, not by gaps",
        "Rolls are hashes of (seed, block, minute, purpose), so visiting order never matters",
        "Snapshots store the minute and every touched block, not the log or the weather",
        "Counting functions (`fireCounts`, `reachOf`) walk the touched box"
      ],
      "card": "entries/wildfire.json"
    },
    {
      "id": "wind-tunnel",
      "aliases": [],
      "name": "A wind tunnel around anything",
      "summary": "A real-time lattice Boltzmann (D2Q9) flow in WebGPU compute around solids you describe as plain shapes: fused pull-streaming and BGK collision with a Smagorinsky eddy viscosity, halfway bounce-back that carries each wall’s own velocity (so spinning wheels, a rolling road and DOM cards dragged through the air all push it), an equilibrium inlet and an open outlet with a sponge. Made visible as smoke streaklines from a rake, free tracers and pressure, vorticity or speed fields, with drag and lift on the measured solids by momentum exchange, read back a few times a second without waiting. Without WebGPU the same runs on WebGL2.",
      "category": "simulation",
      "role": "hero-visual",
      "stack": [
        "webgpu"
      ],
      "character": "balanced",
      "tags": [
        "lattice boltzmann",
        "interactive",
        "drag and rotate",
        "d2q9",
        "cfd",
        "fluid",
        "compute",
        "raw webgpu",
        "wgsl",
        "streaklines",
        "smoke",
        "tracers",
        "pressure",
        "vorticity",
        "drag",
        "lift",
        "aerodynamics",
        "moving walls",
        "dom + gpu",
        "atomics",
        "timestamp queries",
        "webgl2 fallback",
        "no dependencies"
      ],
      "useCases": [
        "aerodynamics on a product page",
        "teaching wakes, stall and vortices",
        "a body people move and turn to see the flow answer",
        "page cards as walls in the wind",
        "live drag and lift for a shape",
        "smoke round obstacles in a game"
      ],
      "interaction": "Drag the body to move it · turn it by its handle or the wheel ([ and ] on the keys) · drag the cards through the air",
      "kits": [],
      "pairsWith": [
        {
          "id": "race-car",
          "why": "A car body to test"
        },
        {
          "id": "compute-gallery",
          "why": "More compute techniques"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 2.264,
          "cpuMs": 0.263,
          "cpuP95Ms": 0.41,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "The sports car on the 512-wide grid (512 × 214 at 1920 × 1080 with the dock), about 16 lattice steps a frame at 60 Hz, 44 smoke lines of 512 particles, 32,768 tracers, one card swept to and fro along the top (the body stays home); 4× multisampled HDR, bloom and tone map; timed with its own timestamp queries."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 7.012,
          "cpuMs": 0.66,
          "cpuP95Ms": 0.795,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": {
            "clock": "timer",
            "p50Ms": 16.67,
            "p99Ms": 18.045,
            "low1Fps": 48.8
          },
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 184 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 6.789,
          "cpuMs": 1.9,
          "cpuP95Ms": 2.22,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 1121 ms."
        }
      ],
      "signatures": [
        {
          "file": "bodies.ts",
          "declarations": "import { type TunnelShape, type Vec2 } from './shapes';\nexport type Body = {\n    shapes: TunnelShape[];\n    outline: number[];\n    wheels: Array<{\n        c: Vec2;\n        r: number;\n    }>;\n    ref: number;\n};\nexport declare function nacaPoints(code?: string, n?: number): number[];\nexport declare function aerofoil({ at, chord, angle, code, tag }: {\n    at: Vec2;\n    chord: number;\n    angle?: number;\n    code?: string;\n    tag?: number;\n}): Body;\nexport declare function cylinder({ at, d, spin, tag }: {\n    at: Vec2;\n    d: number;\n    spin?: number;\n    tag?: number;\n}): Body;\nexport declare function plate({ at, length, thickness, angle, tag }: {\n    at: Vec2;\n    length: number;\n    thickness?: number;\n    angle?: number;\n    tag?: number;\n}): Body;\nexport declare const CAR_PROFILE: number[];\nexport declare const CAR_CLEARANCE = 0.034;\nexport type WheelMode = 'drawn' | 'gap';\nexport declare function car({ x, ground, length, tag, wheels: mode, tyreShare, minGap, road }: {\n    x: number;\n    ground: number;\n    length: number;\n    tag?: number;\n    wheels?: WheelMode;\n    tyreShare?: number;\n    minGap?: number;\n    road?: number;\n}): Body;"
        },
        {
          "file": "shapes.ts",
          "declarations": "export type Vec2 = [\n    number,\n    number\n];\nexport declare const TAG: {\n    readonly body: 1;\n    readonly wing: 2;\n    readonly wall: 3;\n};\nexport declare const WALL_SPEED_LIMIT = 0.12;\ntype Moving = {\n    tag?: number;\n    vel?: Vec2;\n};\nexport type PolyShape = Moving & {\n    kind: 'poly';\n    pts: ArrayLike<number>;\n    pivot?: Vec2;\n    omega?: number;\n};\nexport type CircleShape = Moving & {\n    kind: 'circle';\n    c: Vec2;\n    r: number;\n    omega?: number;\n};\nexport type RectShape = Moving & {\n    kind: 'rect';\n    c: Vec2;\n    half: Vec2;\n    radius?: number;\n};\nexport type TunnelShape = PolyShape | CircleShape | RectShape;\nexport declare function shapeBounds(s: TunnelShape): [\n    number,\n    number,\n    number,\n    number\n];\nexport declare function roundedBoxDistance(px: number, py: number, hx: number, hy: number, r: number): number;\nexport declare function insideShape(s: TunnelShape, x: number, y: number): boolean;\nexport declare function wallVelocity(s: TunnelShape, x: number, y: number): Vec2;\nexport declare function rasterise(shapes: readonly TunnelShape[], nx: number, ny: number): Uint8Array<ArrayBuffer>;\nexport declare function rotatePoints(pts: ArrayLike<number>, pivot: Vec2, angle: number): number[];\nexport type BoxRect = {\n    left: number;\n    top: number;\n    width: number;\n    height: number;\n};\nexport declare function domRectToShape(rect: BoxRect, host: BoxRect, cell: number, { radius, tag, moved, steps }?: {\n    radius?: number | undefined;\n    tag?: 3 | undefined;\n    moved?: Vec2 | undefined;\n    steps?: number | undefined;\n}): RectShape;\nexport declare function rake(count: number, x: number, y0: number, y1: number): Vec2[];\nexport declare function posePoints(pts: ArrayLike<number>, pivot: Vec2, angle: number, offset: Vec2): number[];\nexport declare function poseShape(s: TunnelShape, pivot: Vec2, angle: number, offset: Vec2, motion?: {\n    vel: Vec2;\n    omega: number;\n}): TunnelShape;\nexport declare function boundsOf(shapes: readonly TunnelShape[]): [\n    number,\n    number,\n    number,\n    number\n];\nexport declare function clampInto(box: readonly number[], room: readonly number[]): Vec2;\nexport declare function reachFrom(shapes: readonly TunnelShape[], pivot: Vec2): number;\nexport declare function approach(from: Vec2, to: Vec2, most: number): Vec2;\nexport {};"
        },
        {
          "file": "tunnel-canvas.ts",
          "declarations": "import { type TunnelCore, type TunnelView, type WindTunnelOptions } from './wind-tunnel';\nexport type TunnelPost = {\n    exposure?: number;\n    bloom?: number;\n    grain?: number;\n};\nexport type TunnelFrame = {\n    run: boolean;\n    view: TunnelView | null;\n    post?: TunnelPost;\n};\nexport type TunnelCanvas = {\n    device: GPUDevice | null;\n    readonly backend: 'webgpu' | 'webgl2';\n    tunnel: TunnelCore;\n    resize(width: number, height: number, dpr: number): void;\n    frame(dt: number, frame: TunnelFrame): boolean;\n    settle(dt: number): void;\n    gpuMs(): number | null;\n    dispose(): void;\n};\nexport type TunnelCanvasOptions = {\n    device?: GPUDevice;\n    msaa?: 1 | 4;\n    tunnel?: Omit<WindTunnelOptions, 'format' | 'depthFormat' | 'sampleCount'>;\n    onError?: (message: string) => void;\n    backend?: 'auto' | 'webgpu' | 'webgl2';\n};\nexport declare function createTunnelCanvas(canvas: HTMLCanvasElement, options?: TunnelCanvasOptions): Promise<TunnelCanvas | null>;"
        },
        {
          "file": "units.ts",
          "declarations": "export declare const SOUND: number;\nexport declare const FORCE_SCALE = 8192;\nexport declare const relaxation: (nu: number) => number;\nexport declare const viscosityOf: (tau: number) => number;\nexport declare const reynolds: (u: number, length: number, nu: number) => number;\nexport declare const viscosityFor: (u: number, length: number, re: number) => number;\nexport declare const mach: (u: number) => number;\nexport declare function coefficients(force: readonly [\n    number,\n    number\n], u: number, length: number, rho?: number): {\n    cd: number;\n    cl: number;\n};\nexport type TunnelForces = {\n    body: [\n        number,\n        number\n    ];\n    wing: [\n        number,\n        number\n    ];\n    steps: number;\n    at: number;\n};\nexport declare function decodeForces(raw: ArrayLike<number>, steps: number, at?: number): TunnelForces;\nexport declare function physicalScale({ cells, metres, speed, u, nu }: {\n    cells: number;\n    metres: number;\n    speed: number;\n    u: number;\n    nu: number;\n}): {\n    dx: number;\n    dt: number;\n    viscosity: number;\n    toMetres: (c: number) => number;\n    toSeconds: (steps: number) => number;\n    toSpeed: (latticeU: number) => number;\n};\nexport declare const forcePerMetre: (coefficient: number, speed: number, length: number, density?: number) => number;\nexport declare function gridFor(width: number, height: number, columns: number, minCell?: number): {\n    nx: number;\n    ny: number;\n    cell: number;\n};\nexport declare const toGrid: (x: number, y: number, cell: number, height: number) => [\n    number,\n    number\n];\nexport declare const fromGrid: (gx: number, gy: number, cell: number, height: number) => [\n    number,\n    number\n];\nexport declare function gridToClip(cell: number, width: number, height: number, out?: Float32Array<ArrayBuffer>): Float32Array<ArrayBuffer>;\nexport declare function runningMean(seconds: number): {\n    add(v: number, dt: number, over?: number): number;\n    readonly value: number;\n    reset(): void;\n};"
        },
        {
          "file": "wind-tunnel.ts",
          "declarations": "import { type TunnelForces } from './units';\nimport type { TunnelShape, Vec2 } from './shapes';\nexport type { TunnelForces } from './units';\nexport type { TunnelShape } from './shapes';\nexport type FieldView = 'smoke' | 'pressure' | 'vorticity' | 'speed';\ntype RGB = readonly [\n    number,\n    number,\n    number\n];\nexport type TunnelLook = {\n    smoke: RGB;\n    smokeI: number;\n    fast: RGB;\n    tracerI: number;\n    slow: RGB;\n    fieldI: number;\n    warm: RGB;\n    cool: RGB;\n    streakW: number;\n    tracerW: number;\n};\nexport type TunnelView = {\n    gridToClip: ArrayLike<number>;\n    viewport: Vec2;\n    look: TunnelLook;\n    field?: FieldView;\n    ink?: boolean;\n    streaks?: boolean;\n    tracers?: boolean;\n    fade?: number;\n    belt?: readonly [\n        number,\n        number,\n        number\n    ];\n};\nexport type TunnelFlow = {\n    u?: number;\n    nu?: number;\n    smag?: number;\n    ground?: 'moving' | 'still';\n    freeze?: number;\n};\nexport type WindTunnelOptions = {\n    format?: GPUTextureFormat;\n    depthFormat?: GPUTextureFormat | null;\n    sampleCount?: number;\n    emitters?: number;\n    perEmitter?: number;\n    tracers?: number;\n    stepsPerSecond?: number;\n    rampSteps?: number;\n};\nexport type WindTunnel = {\n    resize(nx: number, ny: number): void;\n    setFlow(flow: TunnelFlow): void;\n    setRake(points: readonly Vec2[]): void;\n    setShapes(shapes: readonly TunnelShape[]): void;\n    compute(encoder: GPUCommandEncoder, dt: number, timestampWrites?: GPUComputePassTimestampWrites): void;\n    afterSubmit(): void;\n    draw(pass: GPURenderPassEncoder, view: TunnelView): void;\n    reset(): void;\n    readonly forces: TunnelForces;\n    readonly grid: [\n        number,\n        number\n    ];\n    readonly u: number;\n    readonly steps: number;\n    readonly ready: boolean;\n    dispose(): void;\n};\nexport type TunnelCore = Omit<WindTunnel, 'compute' | 'afterSubmit' | 'draw'>;\nexport declare function createWindTunnel(device: GPUDevice, options?: WindTunnelOptions): Promise<WindTunnel>;"
        }
      ],
      "pitfalls": [
        "Keep the wind under about 0.12 cells a step (Mach 0.2)",
        "The Reynolds number decides the flow, not the speed",
        "Never start the air impulsively",
        "A 2D lattice is a slice: its drag and lift are per unit span and at a Reynolds number of a few…",
        "One reading is a fraction of a shedding cycle",
        "Cards and panels you make solid crowd the air too",
        "Never make a car’s wheels full solids on the road in a side view",
        "Steps follow real time (stepsPerSecond, at most 16 a frame), always an even number",
        "Shapes are tested at cell centres",
        "A solid that jumps leaves its old cells to be refilled with its velocity",
        "forces is read from a buffer copied every 20 frames and mapped without waiting",
        "Without WebGPU, createTunnelCanvas runs the WebGL2 port",
        "A new grid (resize) starts the air again",
        "The field draws nothing inside solids",
        "A body the user moves must not teleport",
        "Clamp a moved body clear of the floor and of the absorbing layers at the inlet"
      ],
      "card": "entries/wind-tunnel.json"
    },
    {
      "id": "word-swarm",
      "aliases": [],
      "name": "Swarm that writes words",
      "summary": "Birds, butterflies, fireflies, drones or darts that flock freely on the GPU, then each fly to their own point of a word or a shape, hold it and let go again. Targets are paired with agents so neighbours stay neighbours; the pointer parts the flock or draws it in. Without WebGPU a WebGL2 twin flies the same flock.",
      "category": "particles",
      "role": "hero-visual",
      "stack": [
        "webgpu",
        "dom"
      ],
      "character": "expressive",
      "tags": [
        "boids",
        "flocking",
        "compute",
        "raw webgpu",
        "wgsl",
        "instancing",
        "text to points",
        "workgroup memory",
        "glsl",
        "webgl2 fallback"
      ],
      "useCases": [
        "hero and splash text",
        "loading and welcome screens",
        "announcing a score or a result",
        "logos that assemble",
        "ambient background life"
      ],
      "interaction": "Click to form the word or scatter it · the pointer parts the flock · Enter toggles",
      "kits": [],
      "pairsWith": [
        {
          "id": "glyph-rivers",
          "why": "Letters that pour into a word"
        },
        {
          "id": "names-wall",
          "why": "A wall of names"
        },
        {
          "id": "fireworks",
          "why": "Bursts after the word"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "unknown GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.39",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-11",
          "gpuMs": 1.423,
          "cpuMs": 0.1,
          "cpuP95Ms": 0.16,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured at the default 2,000 birds over the sky: one compute pass (every agent against every other, through workgroup memory) and one instanced draw, timed with timestamp queries. The bench cycles itself through flocking, forming the word and letting go."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 1.442,
          "cpuMs": 0.21,
          "cpuP95Ms": 0.37,
          "badge": "moderate",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (dom): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 160 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 6.195,
          "cpuMs": 0.18,
          "cpuP95Ms": 0.24,
          "badge": "heavy",
          "drawCalls": 0,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 69 ms."
        }
      ],
      "signatures": [
        {
          "file": "points.ts",
          "declarations": "export type Point = [\n    number,\n    number\n];\nexport type Mask = {\n    width: number;\n    height: number;\n    data: Uint8Array;\n};\nexport declare function drawMask(width: number, height: number, draw: (ctx: CanvasRenderingContext2D) => void): Mask;\nexport declare function textMask(text: string, font?: string): Mask;\nexport type MaskPointOptions = {\n    count?: number;\n    outline?: boolean;\n    x?: number;\n    y?: number;\n    scale?: number;\n};\nexport declare function maskPoints(mask: Mask, { count, outline, x, y, scale }?: MaskPointOptions): Point[];\nexport type TextPointOptions = Omit<MaskPointOptions, 'x' | 'y' | 'scale'> & {\n    x: number;\n    y: number;\n    size?: number;\n    maxWidth?: number;\n    weight?: number | string;\n    family?: string;\n};\nexport declare function textPoints(text: string, { x, y, size, maxWidth, weight, family, ...rest }: TextPointOptions): Point[];\nexport declare function fitPoints(points: Point[], n: number): Point[];\nexport declare function assignTargets(from: ArrayLike<number>, to: ArrayLike<number>, n: number): Uint32Array;"
        },
        {
          "file": "swarm-gl.ts",
          "declarations": "import { type Swarm, type SwarmSettings } from './swarm';\nexport type SwarmGL = Omit<Swarm, 'step' | 'draw'> & {\n    step(dt: number): void;\n    draw(): void;\n};\nexport declare function createSwarmGL(gl: WebGL2RenderingContext, { capacity, ...initial }?: Partial<SwarmSettings> & {\n    capacity?: number;\n}): SwarmGL | null;"
        },
        {
          "file": "swarm.ts",
          "declarations": "import { type Point } from './points';\nexport type Species = 'bird' | 'butterfly' | 'firefly' | 'drone' | 'dart';\nexport declare const SPECIES: Record<Species, number>;\nexport type PointerMode = 'avoid' | 'attract' | 'off';\nexport type Rect = {\n    x: number;\n    y: number;\n    width: number;\n    height: number;\n};\nexport type SwarmSettings = {\n    count: number;\n    species: Species;\n    colours: string[];\n    speed: number;\n    separation: number;\n    alignment: number;\n    cohesion: number;\n    radius: number;\n    wander: number;\n    size: number;\n    flap: number;\n    hover: number;\n    pointer: PointerMode;\n    pointerRadius: number;\n    view: {\n        width: number;\n        height: number;\n    };\n    bounds: Rect | null;\n};\nexport type Swarm = {\n    readonly capacity: number;\n    readonly settings: Readonly<SwarmSettings>;\n    readonly form: number;\n    readonly holding: boolean;\n    readonly ready: Promise<void>;\n    set(values: Partial<SwarmSettings>): void;\n    spawn(area?: Rect): void;\n    formTo(points: Point[], seconds?: number): Promise<void>;\n    release(seconds?: number): void;\n    scatter(x: number, y: number, strength?: number): void;\n    pointerAt(x: number | null, y?: number): void;\n    step(encoder: GPUCommandEncoder, dt: number, timestampWrites?: GPUComputePassTimestampWrites): void;\n    draw(pass: GPURenderPassEncoder): void;\n    dispose(): void;\n};\nexport declare const DEFAULTS: SwarmSettings;\nexport declare function rgb(css: string): [\n    number,\n    number,\n    number\n];\nexport declare function createSwarm(device: GPUDevice, { format, capacity, ...initial }: Partial<SwarmSettings> & {\n    format: GPUTextureFormat;\n    capacity?: number;\n}): Swarm;"
        }
      ],
      "pitfalls": [
        "Every agent looks at every other",
        "Read one buffer and write the other (ping-pong)",
        "formTo reads the agents back once (a frame or two late) to pair them with targets",
        "Draw into an opaque target",
        "The uniforms are written to the queue in step()",
        "Text is drawn to a canvas, so wait for document.fonts.ready before the first textPoints",
        "Under reduced motion, slow them, calm the wander and release without a burst",
        "Without WebGPU, createSwarmGL (swarm-gl.ts) flies the same flock on WebGL2"
      ],
      "card": "entries/word-swarm.json"
    },
    {
      "id": "world-pinned-labels",
      "aliases": [],
      "name": "Labels pinned to a 3D world",
      "summary": "Crisp HTML labels that follow points in a 3D scene: projected from a plain view-projection matrix each frame, stacked nearest on top, scaled a little with distance, sliding down their beam to stay on screen close up and in from the sides near an edge, hidden under your panels and culled off screen or behind the camera. A click on the world picks the nearest beam. Real buttons, one Tab stop, arrows that move across the screen. Pick it over SDF text when the labels are few, must be selectable and accessible and take your app’s CSS; it is for points in a world, where beside-placement is for popovers by DOM items.",
      "category": "ui",
      "role": "foundation",
      "stack": [
        "dom"
      ],
      "character": "calm",
      "tags": [
        "labels",
        "annotations",
        "hud",
        "projection",
        "world to screen",
        "occlusion",
        "picking",
        "3d",
        "maps",
        "roving tabindex",
        "keyboard",
        "accessibility",
        "dom",
        "css",
        "no dependencies"
      ],
      "useCases": [
        "names and readings over sites on a 3D map",
        "markers on a product model or a building",
        "players, units or waypoints in a game",
        "callouts in a scientific or data scene",
        "any HUD text that must stay crisp, selectable and readable by a screen reader"
      ],
      "interaction": "Drag to orbit · click a beam or a label · Tab to the labels, then the arrow keys",
      "kits": [
        {
          "kit": "game",
          "as": "optional"
        },
        {
          "kit": "product-presentation",
          "as": "core"
        }
      ],
      "pairsWith": [
        {
          "id": "camera-director",
          "why": "Labels that follow shots"
        },
        {
          "id": "earth-globe",
          "why": "City labels on the globe"
        },
        {
          "id": "game-cameras",
          "why": "Names and markers over a game world"
        }
      ],
      "variants": [],
      "version": "1.1.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "dom",
        "gpu": "none",
        "drivenBy": "cpu",
        "three": null,
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": true
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/156.0.8078.81",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-07",
          "gpuMs": 0.355,
          "cpuMs": 0.46,
          "cpuP95Ms": 0.645,
          "badge": "light",
          "drawCalls": 7,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured while the camera orbits and two readings change every second: all 16 labels are projected each frame and those that moved are written (one transform each)."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 2.425,
          "cpuMs": 0.95,
          "cpuP95Ms": 1.84,
          "badge": "heavy",
          "drawCalls": 7,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 257 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 1.42,
          "cpuMs": 0.08,
          "cpuP95Ms": 0.16,
          "badge": "moderate",
          "drawCalls": 7,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 571 ms."
        }
      ],
      "signatures": [
        {
          "file": "project.ts",
          "declarations": "export type Vec3 = readonly [\n    number,\n    number,\n    number\n];\nexport type Mat4 = ArrayLike<number>;\nexport type Viewport = {\n    width: number;\n    height: number;\n};\nexport type ScreenPoint = {\n    x: number;\n    y: number;\n    w: number;\n};\nexport type Rect = {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n};\nexport type Direction = 'left' | 'right' | 'up' | 'down';\nexport declare function project(m: Mat4, p: Vec3, view: Viewport, out?: ScreenPoint): ScreenPoint | null;\nexport declare function distance(a: Vec3, b: Vec3): number;\nexport type ScaleOptions = {\n    at: number;\n    min?: number;\n    max?: number;\n};\nexport declare function distanceScale(dist: number, o: ScaleOptions): number;\nexport declare function beamSlide(m: Mat4, base: Vec3, top: Vec3, floor: number, view: Viewport): number;\nexport declare function lerp3(a: Vec3, b: Vec3, t: number, out?: [\n    number,\n    number,\n    number\n]): [\n    number,\n    number,\n    number\n];\nexport declare function inView(p: {\n    x: number;\n    y: number;\n}, view: Viewport, margin?: {\n    x: number;\n    y: number;\n}): boolean;\nexport declare function labelBox(p: {\n    x: number;\n    y: number;\n}, size: {\n    w: number;\n    h: number;\n}, scale: number, gap: number, out?: Rect): Rect;\nexport declare function slideInside(x: number, half: number, width: number, edge?: number): number;\nexport declare function coveredBy(box: Rect, rects: ArrayLike<Rect>, margin?: number): boolean;\nexport declare function distanceToSegment(x: number, y: number, a: {\n    x: number;\n    y: number;\n}, b: {\n    x: number;\n    y: number;\n} | null): number;\nexport type Pickable = {\n    top: {\n        x: number;\n        y: number;\n    };\n    base: {\n        x: number;\n        y: number;\n    } | null;\n} | null;\nexport declare function pickNearest(items: ArrayLike<Pickable>, x: number, y: number, radius?: number): number;\nexport declare function stepToward(from: {\n    x: number;\n    y: number;\n}, points: ArrayLike<{\n    x: number;\n    y: number;\n} | null>, dir: Direction): number;\nexport type PlaceOptions = {\n    scale?: ScaleOptions | false;\n    floor?: number;\n    cull?: {\n        x: number;\n        y: number;\n    };\n};\nexport type Placement = {\n    state: 'shown' | 'out' | 'behind';\n    x: number;\n    y: number;\n    w: number;\n    scale: number;\n    dist: number;\n    t: number;\n};\nexport declare function placeLabel(m: Mat4, at: Vec3, base: Vec3 | null, camera: Vec3, view: Viewport, o?: PlaceOptions, out?: Placement): Placement;"
        },
        {
          "file": "world-labels.ts",
          "declarations": "import { type Mat4, type Rect, type ScaleOptions, type Vec3, type Viewport } from './project';\nexport type LabelSpec = {\n    id: string;\n    at: Vec3;\n    base?: Vec3 | null;\n    text: string;\n    value?: string | null;\n    name?: string;\n    status?: string;\n    onSelect?: (id: string) => void;\n};\nexport type WorldLabelsOptions = {\n    label?: string;\n    scale?: ScaleOptions | false;\n    hideUnder?: boolean;\n    covers?: Array<Element | Rect>;\n    coverMargin?: number;\n    max?: number;\n    top?: number;\n    edge?: number | false;\n    gap?: number;\n    cull?: {\n        x: number;\n        y: number;\n    };\n    pickRadius?: number;\n    snap?: boolean;\n    renderLabel?(el: HTMLElement, spec: Partial<LabelSpec> & {\n        id: string;\n    }, first: boolean): void;\n};\nexport type LabelState = 'shown' | 'under' | 'crowd' | 'out' | 'behind';\nexport type WorldLabels = {\n    readonly layer: HTMLElement;\n    add(spec: LabelSpec): HTMLElement;\n    update(id: string, change: Partial<Omit<LabelSpec, 'id' | 'onSelect'>>): void;\n    remove(id: string): void;\n    get(id: string): HTMLElement | undefined;\n    placement(id: string): {\n        x: number;\n        y: number;\n        scale: number;\n        state: LabelState;\n        dist: number;\n    } | null;\n    frame(viewProj: Mat4, cameraPos: Vec3, viewport: Viewport): number;\n    pick(x: number, y: number): string | null;\n    setCovers(covers: Array<Element | Rect>): void;\n    measure(): void;\n    configure(change: Partial<WorldLabelsOptions>): void;\n    dispose(): void;\n};\nexport declare function createWorldLabels(host: HTMLElement, options?: WorldLabelsOptions): WorldLabels;"
        }
      ],
      "pitfalls": [
        "Pass projection × view (camera.projectionMatrix × camera.matrixWorldInverse in three.js)",
        "The viewport you pass must be the canvas’s size in CSS pixels",
        "Distance scaling needs your world’s scale",
        "Covers are measured when they or the host change size (ResizeObserver) and on window resize",
        "A hidden label (under a panel, past `max`, off screen) gets visibility",
        "Add labels in the order a screen reader should read them",
        "A moving label is hard to click",
        "Hundreds of labels: the DOM layer is right for tens",
        "Near the left or right edge a label slides in to stay whole and its stem leans back to the point",
        "Import world-labels.base.css before world-labels.css"
      ],
      "card": "entries/world-pinned-labels.json"
    },
    {
      "id": "world-surfaces",
      "aliases": [],
      "name": "World-space procedural surfaces",
      "summary": "Twenty-four ground, wall and roof finishes evaluated directly from world coordinates: brick, timber, corrugated metal, concrete, grass, gravel, snow, lava and more. Pixel footprints soften joints toward their average coverage and fade fine relief before it aliases. A plain-data catalogue supplies colours, dimensions, hints and recommended values; live edits update uniforms without a bake or shader rebuild.",
      "category": "surface",
      "role": "foundation",
      "stack": [
        "three"
      ],
      "character": "balanced",
      "tags": [
        "procedural",
        "world space",
        "materials",
        "surfaces",
        "no UVs",
        "anti-aliasing",
        "fwidth",
        "brick",
        "timber",
        "terrain",
        "relief",
        "tsl"
      ],
      "useCases": [
        "walls and ground with patterns at metre scale",
        "brick mortar and corrugation that fade smoothly with distance",
        "live material tuning without baking textures",
        "a portable catalogue of ground and wall finishes"
      ],
      "interaction": "Click a yard part or select it · choose a finish · edit Surface parameters · compare Shimmer guard while zooming",
      "kits": [],
      "pairsWith": [
        {
          "id": "sun-shadow",
          "why": "Light the surface with a directional sun and geometric shadows"
        },
        {
          "id": "heightfield-chunks",
          "why": "Supply ground meshes whose material uses world coordinates"
        },
        {
          "id": "material-designer",
          "why": "An alternative when a layered recipe and exported texture maps are needed"
        }
      ],
      "variants": [],
      "version": "1.0.2",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "gpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": {
          "medium": "Full procedural finishes and bump normals",
          "low": "Procedural colour and shimmer guard; no bump normals, 1024 sun shadow"
        },
        "reducedMotion": false
      },
      "toneKnobs": [
        {
          "name": "bump",
          "in": "module",
          "values": {
            "strict": 0.2,
            "refined": 0.6,
            "playful": 1.5
          },
          "note": "Relief strength; 1 is the authored physical depth, within each surface’s own range"
        }
      ],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 0.388,
          "cpuMs": 0.28,
          "cpuP95Ms": 0.39,
          "badge": "light",
          "drawCalls": 37,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.155,
            "p99Ms": 6.18,
            "low1Fps": 154.1
          },
          "notes": "Default whole yard: brick house, corrugated roof, timber shed, grass, gravel, concrete slabs and dirt, with a fitted sun shadow and hemisphere sky light. Shimmer guard on, no zoom or parameter edits. No textures, compute or bake; idle frames are held outside benchmarks. Other catalogue finishes have different fragment costs."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "intel xe-2lpg",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Microsoft Edge 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 1.376,
          "cpuMs": 0.64,
          "cpuP95Ms": 0.92,
          "badge": "moderate",
          "drawCalls": 37,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Microsoft Edge 157, Chromium 157 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 12643 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-19",
          "gpuMs": 5.393,
          "cpuMs": 0.88,
          "cpuP95Ms": 1.3,
          "badge": "heavy",
          "drawCalls": 37,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 10071 ms."
        }
      ],
      "signatures": [
        {
          "file": "surfaces.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Node, UniformNode } from 'three/webgpu';\nimport { type SurfaceKind, type SurfaceParam } from './surface-catalogue';\ntype ColorUniform = UniformNode<'color', THREE.Color>;\ntype NumberUniform = UniformNode<'float', number>;\nexport type { SurfaceKind, SurfaceParam };\ntype Built = {\n    color: Node<'vec3'>;\n    roughness: Node<'float'>;\n    height: Node<'float'>;\n    slope?: Node<'vec2'>;\n    metalness?: Node<'float'>;\n    glow?: Node<'float'>;\n};\nexport declare const SURFACE_GLOW = 2.6;\ntype Inputs = {\n    colors: Record<string, ColorUniform>;\n    numbers: Record<string, NumberUniform>;\n    coords: Node<'vec2'>;\n    above: Node<'float'>;\n};\nexport type SurfaceDefinition = {\n    id: string;\n    name: string;\n    kind: SurfaceKind;\n    params: SurfaceParam[];\n    build: (inputs: Inputs) => Built;\n    water?: {\n        wet: string;\n        dry: string;\n    };\n};\nexport declare function bumpNormal(height: Node<'float'>, strength: Node<'float'>, base: Node<'vec3'>, regular?: Node<'vec2'>): THREE.Node<\"vec3\">;\nexport declare const LAVA_TILE = 8;\nexport declare const lavaPlatesPerTile: (plate: number) => number;\nexport declare const SURFACES: SurfaceDefinition[];\nexport type SurfaceMaterial = {\n    definition: SurfaceDefinition;\n    material: THREE.MeshStandardNodeMaterial;\n    set: (key: string, value: string | number) => void;\n    values: () => Record<string, string | number>;\n};\nexport type SurfaceNodes = {\n    color: Node<'vec3'>;\n    roughness: Node<'float'>;\n    metalness: Node<'float'>;\n    emissive: Node<'vec3'> | null;\n    normal: Node<'vec3'>;\n    set: (key: string, value: string | number) => void;\n    values: () => Record<string, string | number>;\n};\nexport declare function surfaceNodes(definition: SurfaceDefinition, overrides?: Record<string, string | number>, coordinates?: Node<'vec2'>): SurfaceNodes;\nexport declare function surfaceBakeNodes(definition: SurfaceDefinition, overrides: Record<string, string | number>, coordinates: Node<'vec2'>): {\n    color: THREE.Node<\"vec3\">;\n    roughness: THREE.Node<\"float\">;\n    metalness: THREE.Node<\"float\">;\n    glow: THREE.Node<\"float\">;\n    height: THREE.Node<\"float\">;\n    slope: THREE.Node<\"vec2\">;\n    bump: Node<\"float\">;\n};\nexport declare function standingWaterLift(definition: SurfaceDefinition, overrides: Record<string, string | number>): number;\nexport declare function createSurfaceMaterial(definition: SurfaceDefinition, overrides?: Record<string, string | number>, coordinates?: Node<'vec2'>): SurfaceMaterial;\nexport declare function surfaceById(id: string): SurfaceDefinition | undefined;"
        }
      ],
      "pitfalls": [
        "World coordinates are Y-up and measured in metres",
        "World projection is not a seamless unwrap",
        "Wall grime measures height above the mesh origin",
        "Relief changes the shading normal, not geometry, silhouette, depth, collision or shadows",
        "Footprint filtering suppresses sub-pixel pattern and normal aliasing",
        "All values start from resolvedValues. set() changes only known catalogue keys",
        "Each surface is a different shader",
        "The catalogue’s fallbackColor is a parameter key for an optional plain-material tier",
        "These graphs run per covered fragment, every drawn frame",
        "Dispose every created material and your geometry"
      ],
      "card": "entries/world-surfaces.json"
    },
    {
      "id": "zfight-check",
      "aliases": [],
      "name": "Z-fighting check with a ratchet",
      "summary": "Finds z-fighting before anyone sees it flicker: triangles on one plane, facing one way, overlapping, grouped by the pair of parts that fight, worst first, in about linear time (a flat floor of thousands of triangles included). A ratchet holds every model to a baseline file: a new model must have none, an old one no more than it had, and only models whose content changed are checked again. Triangles in, findings out, with a GLB reader that needs no three.js and a three.js adapter that also flies to a fight, lights its faces and nudges the smaller part clear.",
      "category": "systems",
      "role": "tooling",
      "stack": [
        "three"
      ],
      "character": "calm",
      "tags": [
        "z-fighting",
        "coplanar faces",
        "flicker",
        "GLB",
        "glTF",
        "model validation",
        "asset pipeline",
        "ratchet",
        "baseline",
        "regression test",
        "CI",
        "spatial hashing",
        "sweep and prune",
        "level of detail",
        "three.js",
        "no dependencies"
      ],
      "useCases": [
        "a test that fails when a new model brings z-fighting",
        "checking exported GLBs before they go into a game or a configurator",
        "cleaning up an old asset library without blocking on it (the ratchet only tightens)",
        "finding duplicated faces left by a modelling tool",
        "checking a scene built in code (kits, walls, procedural buildings)",
        "pointing an artist straight at the faces that flicker"
      ],
      "interaction": "Pick a finding to fly to it · Fix, then run the check again · drop a .glb to check your own",
      "kits": [],
      "pairsWith": [
        {
          "id": "perf-gates",
          "why": "Run it as a gate"
        },
        {
          "id": "gltf-motion",
          "why": "Check models as they are gated"
        },
        {
          "id": "auto-instancer",
          "why": "Check the instanced scene"
        }
      ],
      "variants": [],
      "version": "1.0.0",
      "licence": "PolyForm-Noncommercial-1.0.0",
      "needs": {
        "api": "webgpu+webgl",
        "gpu": "webgpu-or-webgl2",
        "drivenBy": "cpu",
        "three": "0.187.0",
        "dependencies": [],
        "demoNeedsWebGPU": false,
        "tiers": null,
        "reducedMotion": false
      },
      "toneKnobs": [],
      "costs": [
        {
          "machine": "reference",
          "reference": true,
          "view": null,
          "method": "measure",
          "gpu": "NVIDIA GeForce RTX 4060 Laptop GPU",
          "cpu": "13th Gen Intel(R) Core(TM) i9-13900H",
          "os": "Windows 11 Pro (10.0.26200)",
          "browser": "Chrome/157.0.8103.79",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-18",
          "gpuMs": 0.169,
          "cpuMs": 0.36,
          "cpuP95Ms": 1.045,
          "badge": "light",
          "drawCalls": 49,
          "computeDispatches": 0,
          "frames": {
            "clock": "paced",
            "p50Ms": 3.577,
            "p99Ms": 6.625,
            "low1Fps": 120
          },
          "notes": "Measured stepping through the findings by itself: every 2.5 s the camera flies to the next fight and its faces pulse, and the whole check (both models, hashes, ratchet) runs again each time. The set is about 30 boxes with shadows from one sun."
        },
        {
          "machine": "arc-140v--core-ultra-7-258v",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "Intel Arc 140V (Xe2-LPG)",
          "cpu": "Intel Core Ultra 7 258V",
          "os": "Windows",
          "browser": "Google Chrome 157, Chromium 157",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-15",
          "gpuMs": 0.852,
          "cpuMs": 0.855,
          "cpuP95Ms": 1.14,
          "badge": "moderate",
          "drawCalls": 49,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Browser bench page (webgpu): a visible tab at the screen's own refresh rate, ? warm-up and 600 paced frames, one round, no bench steps. Loaded in 269 ms."
        },
        {
          "machine": "iphone-17-pro",
          "reference": false,
          "view": null,
          "method": "browser",
          "gpu": "apple",
          "cpu": "Apple A19 Pro",
          "os": "iPhone",
          "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1",
          "resolution": "1920×1080",
          "tier": "high",
          "measured": "2026-11-16",
          "gpuMs": 1.574,
          "cpuMs": 0.18,
          "cpuP95Ms": 0.26,
          "badge": "moderate",
          "drawCalls": 49,
          "computeDispatches": 0,
          "frames": null,
          "notes": "Measured with the store's bench page in a visible Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5.2 Mobile/15E148 Safari/604.1 tab: frames paced by the GPU, the demo in bench mode, no bench steps played. Loaded in 456 ms."
        }
      ],
      "signatures": [
        {
          "file": "coplanar.ts",
          "declarations": "export type Vec3 = [\n    number,\n    number,\n    number\n];\nexport type Alternative = {\n    set: string;\n    choice: string;\n};\nexport type Tri = {\n    owner: string;\n    v: [\n        Vec3,\n        Vec3,\n        Vec3\n    ];\n    alternatives?: Alternative[];\n};\nexport type CoplanarOptions = {\n    distance?: number;\n    alignment?: number;\n    minArea?: number;\n    keepPairs?: number;\n};\nexport type Finding = {\n    parts: string;\n    owners: [\n        string,\n        string\n    ];\n    triangles: number;\n    area: number;\n    near: Vec3;\n    normal: Vec3;\n    min: Vec3;\n    max: Vec3;\n    ownerAreas: [\n        number,\n        number\n    ];\n    pairs: Array<[\n        number,\n        number\n    ]>;\n};\nexport declare function findCoplanarOverlaps(tris: readonly Tri[], options?: CoplanarOptions): Finding[];\nexport declare function describeFinding(f: Finding, unitsPerMetre?: number): string;"
        },
        {
          "file": "glb.ts",
          "declarations": "import type { Alternative, Tri } from './coplanar';\nexport type GlbConventions = {\n    skipNode?: (name: string) => boolean;\n    lod?: RegExp | null;\n    exclusiveChild?: (parent: string, child: string) => boolean;\n    variant?: (extras: unknown) => Alternative | null;\n};\nexport type GlbTriangles = {\n    triangles: Tri[];\n    skipped: string[];\n    extensions: string[];\n};\nexport declare class GlbError extends Error {\n}\ntype Json = {\n    scene?: number;\n    scenes?: Array<{\n        nodes?: number[];\n    }>;\n    nodes?: Array<{\n        name?: string;\n        mesh?: number;\n        children?: number[];\n        matrix?: number[];\n        translation?: number[];\n        rotation?: number[];\n        scale?: number[];\n        extras?: unknown;\n    }>;\n    meshes?: Array<{\n        primitives: Array<{\n            attributes: Record<string, number>;\n            indices?: number;\n            mode?: number;\n        }>;\n    }>;\n    accessors?: Array<{\n        bufferView?: number;\n        byteOffset?: number;\n        componentType: number;\n        count: number;\n        type: string;\n        normalized?: boolean;\n        sparse?: unknown;\n    }>;\n    bufferViews?: Array<{\n        buffer: number;\n        byteOffset?: number;\n        byteLength: number;\n        byteStride?: number;\n    }>;\n    buffers?: Array<{\n        byteLength: number;\n        uri?: string;\n    }>;\n    extensionsUsed?: string[];\n    extensionsRequired?: string[];\n};\nexport declare const defaultConventions: Required<GlbConventions>;\nexport declare function readGlb(input: ArrayBuffer | Uint8Array): {\n    json: Json;\n    bin: DataView | null;\n};\nexport declare function glbTriangles(input: ArrayBuffer | Uint8Array, conventions?: GlbConventions): GlbTriangles;\nexport {};"
        },
        {
          "file": "ratchet.ts",
          "declarations": "import type { Tri } from './coplanar';\nexport type Baseline = {\n    note?: string;\n    models: Record<string, string | [\n        string,\n        number\n    ]>;\n};\nexport type ModelInput = {\n    name: string;\n    hash: string;\n    count: () => number;\n};\nexport type RatchetStatus = 'unchanged' | 'same' | 'better' | 'worse' | 'new' | 'new-fights';\nexport type RatchetResult = {\n    name: string;\n    hash: string;\n    status: RatchetStatus;\n    allowed: number;\n    count: number | null;\n    ok: boolean;\n    message: string;\n};\nexport type RatchetReport = {\n    results: RatchetResult[];\n    ok: boolean;\n    gone: string[];\n};\nexport declare function allowance(baseline: Baseline, name: string): {\n    hash: string;\n    allowed: number;\n} | null;\nexport declare function checkRatchet(baseline: Baseline, models: readonly ModelInput[]): RatchetReport;\nexport declare function tighten(baseline: Baseline, report: RatchetReport): Baseline;\nexport declare function rebuildBaseline(models: ReadonlyArray<{\n    name: string;\n    hash: string;\n    count: number;\n}>, note?: string): Baseline;\nexport declare function formatBaseline(baseline: Baseline): string;\nexport declare function parseBaseline(text: string): Baseline;\nexport declare function contentHash(bytes: ArrayBuffer | ArrayBufferView): Promise<string>;\nexport declare function trianglesHash(tris: readonly Tri[]): Promise<string>;"
        },
        {
          "file": "three-scene.ts",
          "declarations": "import * as THREE from 'three/webgpu';\nimport type { Alternative, Finding, Tri } from './coplanar';\nexport type SceneTriangles = {\n    triangles: Tri[];\n    sources: Array<{\n        mesh: THREE.Mesh;\n        face: number;\n        instance: number;\n    }>;\n    meshes: Map<string, THREE.Mesh>;\n};\nexport type SceneOptions = {\n    include?: (mesh: THREE.Mesh) => boolean;\n    owner?: (mesh: THREE.Mesh) => string;\n    alternatives?: (mesh: THREE.Mesh) => Alternative[] | undefined;\n};\nexport declare function sceneTriangles(root: THREE.Object3D, options?: SceneOptions): SceneTriangles;\nexport declare function findingGeometry(finding: Finding, triangles: readonly Tri[], lift?: number, which?: 'smaller' | 'both'): THREE.BufferGeometry;\nexport declare function nudgeApart(finding: Finding, scene: SceneTriangles, by?: number): {\n    mesh: THREE.Mesh;\n    owner: string;\n} | null;\nexport type Viewpoint = {\n    target: THREE.Vector3;\n    position: THREE.Vector3;\n};\nexport declare function viewpointFor(finding: Finding, triangles: readonly Tri[], obstacles: THREE.Object3D[], options?: {\n    fov?: number;\n    prefer?: THREE.Vector3;\n}): Viewpoint;"
        }
      ],
      "pitfalls": [
        "Only faces facing the same way are compared",
        "The tolerance is in the model’s units",
        "A fix must move a part further than the tolerance, or the check still reports it",
        "A part that fights on several sides",
        "The overlap test is a probe test",
        "The baseline does not record the tolerance",
        "Prefer `tighten` to `rebuildBaseline` after fixing",
        "Levels of detail and exclusive parts in one file overlap by design",
        "The reader does not decode Draco or meshopt geometry, sparse accessors",
        "Skinned and morphing meshes are checked in their rest pose only",
        "The hash in the baseline is of the file’s bytes"
      ],
      "card": "entries/zfight-check.json"
    }
  ]
}
