Skip to content

Studio: bake the blurred chat wallpaper once instead of re-running the blur on every scroll frame - #17253

Merged
danielhanchen merged 1 commit into
mainfrom
studio-wallpaper-bake
Nov 9, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
studio-wallpaper-bake

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Problem

With a chat wallpaper, scrolling a chat cost 3x to 6x more than without one, Glass off included. The wallpaper artwork carries a live filter: blur(), and it sits behind the thread viewport, which is see-through with a wallpaper, so every scroll frame runs the blur again over the whole window.

Ablation on the long-chat gate (Chromium, thread scroll with a wallpaper, Glass off, 2 readings each):

Change Thread scroll vs no wallpaper
main 4.2x, 5.7x
composer backdrop-filter removed 3.5x, 4.8x (not the cause)
live artwork blur removed 1.9x, 2.4x (the cause)
blurred artwork on its own layer (will-change) 7.7x, 8.8x (the compositor then re-blurs every frame)

Change

  • New WallpaperArtwork (artwork.tsx) paints the box exactly as the CSS background did (same sizing, position, clipped to the box), blurs it once on a canvas, and shows that bitmap. transform: scale(zoom) stays in CSS, keeping the filter-then-transform order.
  • The live filter only shows until a bake for the current inputs (image, sizing, position, blur, box size, device pixel ratio) exists, so slider drags and window resizes stay instant and re-bake 160 ms after they settle. The outgoing frame of a crossfade keeps the live filter for its 180 ms.
  • Wide blurs bake at a lower resolution. Engines without canvas filter (older WebKit) use a downscale and smooth upscale. An image the canvas cannot read (cross-origin) keeps the live filter, as today. Baked URLs are revoked.
  • The geometry is a pure module (artwork-geometry.ts) with unit tests.

Results

Long-chat gate, Chromium, 40 turns, 3 rotated runs per arm, main also run as an A/A arm (6 readings):

Thread scroll main this PR
wallpaper, Glass off, vs no wallpaper 3.0x to 4.4x (over the gate's 4x in 3 of 6) 1.7x, 1.7x, 2.8x
wallpaper, Liquid 3D, vs Liquid 3D 1.6x to 2.2x 1.0x to 2.0x

Source card with a wallpaper: 1.4x to 6.7x on main, 1.2x to 1.6x here. Composer menu: 1.2x to 1.9x on main, 1.1x to 1.4x here.

Look

Unchanged in practice: in wallpaper-only regions main and this PR differ by at most 2 to 3 levels of 255 (p99 1 to 2), in both solid and Glass. Left: main. Right: this PR.

Wallpaper, Glass off, main vs this PR

Wallpaper, Liquid 3D, main vs this PR

Tests

  • New tests/wallpaper-artwork.test.ts: geometry for all six sizings, the bake scale and the wiring.
  • Frontend node suite 15,328 pass, tsc --noEmit clean.
  • A follow-up PR adds wallpaper modes to the long-chat gate (with a check that the artwork is baked, so a silent fallback to the live filter fails).
  • Not measured here: real WebKit, Desktop shells and GPU compositing. The canvas path without filter support has unit coverage only.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T15:51:08.655352Z 9809426 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 98094264db

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 81b7720 into main Nov 9, 2026
@danielhanchen
danielhanchen deleted the studio-wallpaper-bake branch November 9, 2026 17:09
shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Nov 9, 2026
… a reason (unslothai#17262)

Stacked on unslothai#17253 (the wallpaper bake): this PR adds wallpaper modes to
the long-chat gate, and without unslothai#17253 thread scroll with a wallpaper
reads 3.0x to 4.6x the default look, over the gate's 4x. Merge unslothai#17253
first.

## Problem

The long-chat gate measures every material and Glass lens it finds in
the source, plus a few fixed variants (menus off, dark). Any other
appearance setting was never measured, so a new slow look could ship the
way Glass first did. Settings the gate did not reach:

- the 22 custom appearance settings (`appearance-custom-store.ts`:
contrast, outlines, cursors, font smoothing, code line numbers / wrap /
ligatures, chat width, font sizes, fonts, colours, sidebar layout)
- Glass strength, which scales the blur up to 2x
- the chat wallpaper, which about 70 Glass rules depend on
(`data-chat-wallpaper-workspace-ready`), plus the wallpaper's own blur
- palettes (`neon-cyberpunk` has its own composer focus glow)

## Change

- `tests/studio/_appearance_coverage.py` reads the appearance settings
from the source (the `DEFAULT_CUSTOMIZATION` keys and each value of
their `*Setting` unions, the persisted Glass store keys, the wallpaper's
`DEFAULT_ADJUSTMENTS`, the palette ids) and scans every `.css` file for
`html` / `:root` attributes and classes on rules that set
`backdrop-filter`, `filter`, animations, `will-change`,
`mix-blend-mode`, masks or box-shadows.
- Each item must map to a gate mode or to an allowlist entry with a
reason. `tests/studio/test_appearance_coverage.py` fails, with a message
saying what to add, when a new setting, value or costly root flag is
neither.
- Six new gate modes at 40 turns on the 8 setting-sensitive areas:
`solid+custom` and `liquid-3d+custom` (the costliest customisation
values), `solid+wallpaper` and `liquid-3d+wallpaper` (a generated
wallpaper seeded into the app's IndexedDB, blur 20), `solid+palette`
(`neon-cyberpunk`) and `liquid-3d+strength-max`.
- Every new mode first checks that its setting reached `<html>`, so a
renamed key cannot silently measure the default look; the wallpaper
modes also wait for unslothai#17253's baked artwork and report the page broken if
the live filter stays.

## Results

- A synthetic `html[data-sparkle-trail]` rule with an animation, a new
`sparkleTrail` setting and a new `chatWidth` value each fail the
coverage test with a clear message; main and this branch pass (37 tests
in `test_area_matrix.py` and `test_appearance_coverage.py`).
- Local gate run of the new modes on this branch (2 runs): thread scroll
with a wallpaper 1.5x and 1.6x the default look (3.2x to 4.6x without
unslothai#17253), every new cell under its limit.
- CI cost: about 6 extra pages at 40 turns, roughly 60 to 75 s on top of
the gate's ~300 s.
- Not covered: settings that only exist on WebKit or in the desktop
shell are listed as such (the gate runs Chromium).
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.

1 participant