Repository navigation
Studio: stop Reduce motion turning on a transition for every element - #17466
Conversation
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
) ## Summary `Repo tests (CPU, rest)` can fail on any PR, depending on which tests share an xdist worker (seen on #17466, which only touches the Studio frontend): ``` tests/test_parallel_env.py:1210: in test_pre_init_query_reads_a_pending_peft_config E AssertionError: Regex pattern did not match. E Expected regex: 'cp x tp' E Actual message: "Unsloth: context parallelism (context_parallel_size = 2) does not compose with tensor parallel (UNSLOTH_TP_SIZE=2) yet: ..." ``` `unsloth.models.tp_env.env_layout()` reads the `UNSLOTH_TP_SIZE` / `UNSLOTH_PARALLEL` layout once per process, by design. `tests/test_parallel_env.py`'s `clean_env` fixture resets that cache on teardown only. When an earlier test in the same worker, from another file, read the layout with tensor parallel unset, `None` stays cached. The test above then sets `UNSLOTH_TP_SIZE=2` and `UNSLOTH_CP_SIZE=2`, `_composed_layout()` sees the stale `None`, and the trainer raises the generic "does not compose" refusal instead of the layout's own `cp x tp` one. The refusal logic and the test's expectation are both right; only the cache crosses tests. Reproduced on main by running any test that calls `env_layout()` before this one (1 failed). ## Change - `tests/conftest.py`: a new autouse fixture clears the tp_env layout cache before every test. It only does so when `unsloth.models.tp_env` is already imported, so it adds no unsloth import to tests that do not use it. - New `tests/test_tp_layout_isolation.py`: the first test leaves the layout read, the second asserts it starts unread. Run in file order without the fixture, the second test fails. No library code changes. ## Testing - `tests/test_tp_layout_isolation.py` with `tests/test_parallel_env.py`, file order: 136 passed. With main's `tests/conftest.py`: `test_the_next_test_starts_with_the_layout_unread` fails. - A test that calls `env_layout()` followed by `test_pre_init_query_reads_a_pending_peft_config`: fails on main, passes here. - With `-n 4` and random order: `test_tp_layout_isolation.py`, `test_parallel_env.py`, `test_tp_env_gloo.py`, `test_pp_env_gloo.py`, `test_parallel_capabilities_precision.py`: 198 passed, 1 skipped.
Summary
Reduce motion is on by default since #17377, and its blanket rule in
index.cssgives every elementtransition-duration: 0.01ms.transition-propertydefaults toall, so that one line turns on transitions for every property of every element, including the many no rule ever meant to animate.Chromium makes this expensive.
* { scrollbar-color }sets a scrollbar colour on every element, and Chromium starts a scrollbar-color transition on each of them whenever they are restyled, even when the value does not change (the from and to keyframes are identical). With any non-autocolour, a body-level restyle in a 40 turn Liquid Glass chat started about 2,000 of these transitions, and more as the chat grows. This is behind the Chromium long-chat gate cells that keep failing on recent PRs (area thread_scroll (liquid-3d)andarea stream (liquid-3d)growing 2.5x to 2.8x from 40 to 200 turns, e.g. #17453 and #17460).Change
html.force-reduced-motion, on by default, and the OSprefers-reduced-motionblock) now give the*blankettransition-duration: 0s. A transition that lasts 0.01ms and one that does not run look the same, so nothing on screen changes and Reduce motion stays on.transitionend:[class*="transition"]), which covers the reasoning and sidebar collapsibles that unmount ontransitionend;native-view.tsfollows by their transition events (CLICKABLE_SELECTOR: toasts, the find bar, native clickables and the rail), so the Desktop browser view keeps its hole in place while they appear.[zoom]effect redraws it.Guard
New
studio/frontend/tests/reduced-motion-implicit-transitions.test.ts:*blanket sets a nonzerotransition-duration, with its own cases for the checker;native-view.ts'sCLICKABLE_SELECTOR, so the two cannot drift apart.reasoning-grid-collapse.test.tsnow checks that the collapse is reached through the class exemption instead of counting the old blanket lines.Against main's
index.cssthe new test and the updated collapse test fail (3 failures); with this change all 20 tests in the four related files pass.Measurements
Chromium (the long-chat gate's headless build and harness, this host), Liquid Glass 3D, main-thread CPU per area at 200 turns, three interleaved runs each:
thread_scrollstreamcommand_paletteScrollbar-color transitions started by one body-level restyle at 40 turns: 2,550 on main, 0 with this change.
Long-chat gate: Settings ceiling
With the blanket transitions gone, the gate's 40 turn reading of opening Settings in the default appearance drops from about 6,100 elements restyled to about 2,400, while the 200 turn reading stays near 7,900. That made
area settings (default)read 3.3x against the 2.0x element-growth limit.The growth itself is on main already. Measured on fresh pages with the gate's harness, default appearance:
The gate only passed on main because the transitions inflated its 40 turn reading.
KNOWN_DEFAULTintests/studio/_area_matrix.pynow records it aslength:settings=5, so Settings keeps a ceiling instead of being skipped. This changes only the element and layout count check for that one area; its CPU and paint growth checks are unchanged. Finding what restyles the thread when Settings opens is a separate fix.Not covered
The Firefox long-chat gate failure that also started with #17377 is a different cost: forcing every transition to 0s does not change the Firefox numbers, so this PR does not address it.