Skip to content

feat(docs): add composition 2, Bit comet - #283

Merged
hunterbecton merged 2 commits into
mainfrom
t3/implement-313
Nov 8, 2026
Merged

hunterbecton merged 2 commits into
mainfrom
t3/implement-313

Conversation

@hunterbecton

Copy link
Copy Markdown
Member

Why

Composition 2 is the Gallery's second entry. It's a heat map on a wall of square LED cells, and the pointer leaves a comet of hot cells behind it. Every part it needs has shipped, so this PR assembles the document.

What changes

The composition

bit-comet/composition.ts stacks FractalNoise, CursorTrail, PaletteMap, and LedWall. Risograph is the default preset. Thermal, Infrared, and Newsprint each list only what they change, and each one sets its gutter color through LedWall's panelColor. The field's ramp stops at the edge of the hottest color's band, so a solid patch of that color always marks the pointer. The comments in the composition document the formula.

Controls

The panel has one color control per palette color, then Drift, Scale, Angle, Heat radius, and Trail length. Color 5 and Color 6 show only on the six-color presets.

Registration and tests

Bit comet comes after Reeded glass in COMPOSITIONS and in scripts/build-posters.sh, with golden files for every preset. gallery-bit-comet.spec.ts asserts WebGL2 and takes one baseline per preset. The Mac and Linux baselines are byte-identical, because PaletteMap snaps each cell to a flat color.

GPU readings

These are median GPU times from /dev/composition-benchmark, at 2× on the M1 Max, with a 3272×1392 buffer:

Preset GPU ms
Risograph 5.28
Thermal 5.41
Infrared 5.28
Newsprint 5.23

Reeded glass reads 3.23 ms on the same machine, which matches its own PR.

Known limitations

  • Every preset is over the 4 ms budget. Each of FractalNoise's six octaves costs about 0.45 ms. Two octaves read 3.9 ms but soften the field, so the author kept six. SHA-314 tracks drawing the field once per cell instead of once per pixel.
  • The poster has the mismatch that SHA-306 describes. A Gallery card shrinks the 1080×720 poster to 288–440 px, so its 8 CSS px cells read as 2–3 px. When the card goes live, they jump to 8 px.
  • The author's reduced-motion check is still pending.

Closes SHA-313

Bit comet is a heat map on a wall of square LED cells. Moving the pointer
across it leaves a comet of hot cells behind. The stack is FractalNoise,
CursorTrail, PaletteMap, and LedWall. Risograph is the default preset.
Thermal, Infrared, and Newsprint are the other presets.

The field's ramp stops at the edge of the hottest color's band. Away from
the comet, the dither gives at most half the cells that color, scattered,
so a solid patch of it always marks the pointer.

The commit registers the composition after Reeded glass, adds its golden
files and Gallery poster, and adds a visual spec with a baseline for each
preset on WebGL2.

Refs SHA-313
Copilot AI balanced review requested due to automatic review settings November 8, 2026 02:15
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 6259644.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The wording incorrectly implies a per-cell execution optimization, but the resample chain runs per output pixel and only shares cell-center sampling coordinates.

1 open issue
What changed in this PR

Adds Bit comet as the second Gallery composition, combining existing shader components into an interactive LED-style heat map with a pointer trail.

Changes:

  • Defines four presets and controls for palette colors, field motion, heat radius, and trail length.
  • Adds generated components and registers Bit comet in the Gallery and poster build.
  • Adds WebGL2 visual-regression coverage for every preset.
File Description
scripts/​build-posters.sh Adds Bit comet to Gallery poster generation.
apps/​docs/​src/​compositions/​index.ts Registers Bit comet after Reeded glass.
apps/​docs/​src/​compositions/​bit-comet/​generated/​thermal.tsx Adds the six-color Thermal component.
apps/​docs/​src/​compositions/​bit-comet/​generated/​newsprint.tsx Adds the grayscale Newsprint component with finer cells.
apps/​docs/​src/​compositions/​bit-comet/​generated/​infrared.tsx Adds the Infrared component with black gutters.
apps/​docs/​src/​compositions/​bit-comet/​generated/​default.tsx Adds the default Risograph component.
apps/​docs/​src/​compositions/​bit-comet/​composition.ts Defines the shader stack, presets, and controls.
apps/​docs-tests/​visual/​gallery-bit-comet.spec.ts Checks WebGL2 rendering and screenshots all four presets.

Review effort: Balanced

The resample chain runs once per pixel. The cell snap only gives every pixel in a cell the same sampling coordinate.
Copilot AI balanced review requested due to automatic review settings November 8, 2026 11:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The preset snapshots never move the pointer over the canvas, so a rendering regression in the comet would go undetected without a clock-controlled moving or held-pointer test covering the hot core and cooling tail.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Add pointer-driven snapshots to verify comet rendering

apps/​docs/​src/​compositions/​bit-comet/​composition.ts:55

The preset snapshots never move the pointer over the canvas, so they do not exercise this composition's comet and would still pass if it stopped rendering. Keep those baselines and add a clock-controlled moving/held-pointer case, following apps/docs-tests/visual/cursor-trail.spec.ts, to verify the hot core and cooling tail through PaletteMap and LedWall.

1 resolved since last review

Review effort: Balanced

@hunterbecton

Copy link
Copy Markdown
Member Author

Not adding pointer-driven snapshots to this PR. SHA-313 keeps the Bit comet spec at rest with no pointer, so its baselines don't depend on EXT_color_buffer_float. Reeded glass has the same gap, so pointer coverage for compositions belongs in a follow-up.

@hunterbecton
hunterbecton merged commit 21c0262 into main Nov 8, 2026
12 checks passed
@hunterbecton
hunterbecton deleted the t3/implement-313 branch November 8, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants