Skip to content

Studio: pause Glass blur through bursts of keys and presses under software compositing - #17237

Merged
danielhanchen merged 1 commit into
mainfrom
studio-glass-interaction-cost
Nov 9, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
studio-glass-interaction-cost

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Follows #17007 (Glass blur paused during scrolls under software compositing). This extends the same pause to bursts of keys, presses and edits.

Problem

Under software compositing (VMs, machines without a usable GPU, CI runners) every frame redraws the whole window and recomputes every backdrop-filter on screen. #17007 paused the blur for scrolls, animations and mounts, but a keystroke or a click still paid for the blur on the sidebar, the Windows glass frame and the composer, even though only text changed. On the long-chat gate (Chromium, software compositing) Glass typing cost 4.1x to 4.9x the default look on main's Frontend CI.

Change

  • glass-motion.ts: keydown, pointerdown and input (paste, IME, autocomplete) hold the standing glass and the surface the event lands in (a dialog or menu) for the same settle window as the motion pause (200 ms after the last event). Listeners are passive and are removed by stop(); starting twice is harmless.
  • Engages only where Studio: drop the live Glass blur while anything moves, on software-composited pages #17007 does: Glass material on, not WebKitGTK (which has no live blur outside the sidebar already) and software compositing detected. With a GPU nothing changes.
  • Long-chat gate: Glass typing gets its own ceiling of 6x per Glass mode (was the blanket 10x), and main's pre-fix CI reading (liquid, 4.9x) joins the runner-readings guard.

Look

Software compositing only: while keys or presses arrive, the sidebar, the Windows glass frame, the composer, the files panel and the touched dialog or menu swap their blur for a 96% opaque fill of their own colour, and the blur returns one frame after 200 ms without input. Text, focus, caret, IME, menus and dialogs behave as before.

Results

Local long-chat gate, 40 turns, ratio to the default look, median (range) of 3 interleaved runs per arm, base runs 1 and 2 doubling as an A/A (median per-cell A/A spread 1.20x; the host was heavily loaded).

Area frosted blurred liquid liquid-3d
type 3.2 -> 1.5 3.1 -> 1.7 3.6 -> 1.3 3.3 -> 1.5
message_click 3.0 -> 1.3 3.6 -> 2.2 2.9 -> 1.7 3.7 -> 2.3
code_copy 2.3 -> 0.7 2.3 -> 1.5 2.4 -> 0.7 2.0 -> 0.8
run_settings 2.5 -> 1.3 2.9 -> 1.3 2.9 -> 1.4 3.0 -> 1.4
api_monitor 4.8 -> 2.6 4.9 -> 3.1 5.2 -> 3.0 5.3 -> 3.0
menus (tools, permission, account, composer) 1.4-1.6 -> 1.0-1.2 1.3-1.8 -> 1.1-1.4 1.6-2.2 -> 1.2-1.3 1.9-2.2 -> 1.3-1.4
thread_scroll / settings_scroll 1.8 / 2.1 -> 2.1 / 2.0 2.3 / 2.3 -> 2.4 / 2.2 2.7 / 3.4 -> 2.2 / 2.8 2.6 / 4.3 -> 2.4 / 3.8

Scrolls are unchanged, as expected (#17007 already covers them). Absolute Liquid 3D CPU under the same load: typing 480 -> 291 ms, message click 433 -> 307 ms.

Tests

  • tests/glass-motion.test.ts: a burst of keys and presses holds the glass and releases it after the settle window; stop() removes the new listeners (13 pass).
  • tests/studio/test_area_matrix.py: 33 pass. Frontend node suite 15,325 pass, tsc --noEmit clean.
  • Not covered locally: GitHub runners (this PR's Frontend CI gate is the check), real WebKit and GPU paths, where the pause is off by design.

Screenshots

Chromium with software compositing, Liquid 3D, light theme, 30-turn chat. Left: at rest (unchanged from main; base vs head at rest differ only by a 1 px scroll offset). Right: the state held while keys or presses arrive (the same state #17007 shows during a scroll).

Chat:

Liquid 3D chat, at rest vs while typing

Settings:

Liquid 3D Settings, at rest vs while typing

Tools menu:

Liquid 3D Tools menu, at rest vs while typing

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@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-09T14:19:00.877565Z cdde121 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: cdde121dd4

ℹ️ 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 pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 9, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 9, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 9, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

Composer (ubuntu-latest, browsers) fails in the long-chat typing-cost gate on this PR:

FAIL: appearance mode liquid-3d+lens-magnify makes area settings_scroll cost 1,850 ms CPU against 415 in liquid-3d at 40 turns = 4.5x (limit 4.0x; LONG_THREAD_AREAS_MAX_RATIO / _KNOWN liquid-3d+lens-magnify:settings_scroll=...)

The PR changes both the Glass blur pausing (glass-motion.ts, index.css) and tests/studio/_area_matrix.py, so this ratio is in its scope rather than a main-wide red; the same gate is green on main. It is a CPU-time ratio, so one rerun is a cheap way to tell noise from a real cost. If it reproduces, the lens-magnify plus settings_scroll pair is the one to look at under the new pause path.

@danielhanchen
danielhanchen merged commit e36630f into main Nov 9, 2026
@danielhanchen
danielhanchen deleted the studio-glass-interaction-cost branch November 9, 2026 16:24
danielhanchen added a commit that referenced this pull request Nov 9, 2026
…rpreter teardown (#17244)

## Summary

`Repo tests (CPU, gloo-tp)` keeps going red on
`tests/test_tp_native_gloo.py::test_trainer_length_samplers_resume_like_an_uninterrupted_run[2-group_by_length]`,
always the same way:

```
E   AssertionError: rank exit codes [-6, 0, 0, 0]
terminate called without an active exception
```

It hit `main` itself (Nov 9 00:25 UTC), #17206 and a staging run of
#17237 within about 15 hours, on PRs that do not touch tensor
parallelism. In each run, one rank of four died with SIGABRT from
`std::terminate` on a joinable C++ thread while the interpreter was
tearing down, after the case had run and the process group had been
destroyed. The other three ranks exited 0. It never reproduced locally,
in 25 runs of that test.

`_worker` now records that the case finished and its result was saved,
destroys the process group as before, then flushes stdio and calls
`os._exit(0)`. Interpreter teardown can no longer change the exit code
of a rank whose work is done. A case that raises, a failed `torch.save`
or a failing `destroy_process_group` still exits non-zero, so the parent
still fails, and the results are still read back and checked exactly as
before.

## Changes

- `tests/test_tp_native_gloo.py`:
- `_worker` skips interpreter teardown once the case has finished and
its result is on disk.
- New `teardown_abort` case, which registers `os.abort` with `atexit` to
stand in for an abort during teardown.
- New test
`test_a_rank_that_finished_is_not_failed_by_an_abort_in_teardown`, which
runs that case on two ranks and expects both results back.

The other `*_gloo.py` suites only import helpers from this file and have
their own workers, so they are unchanged.

## Testing

- The new test passes. With the `os._exit` path disabled it fails with
`rank exit codes` on the `atexit` abort, so it guards the fix.
- The full `tests/test_tp_native_gloo.py` passes locally (57 passed).
- ruff and the scanner-shape and exec-literal lints are clean.
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