Repository navigation
Studio: keep the thread window off a streaming reply's back, and compare long-chat cost with the base build in CI - #17597
Conversation
A window slide that is not urgent goes out as a React transition. Every streamed chunk is a synchronous store update, and React restarts a transition render from the root on each one, so a slide issued while a reply streams rendered its rows again for every chunk and landed only once the reply ended. Until then no step ran, so a reader who had scrolled away looked at a spacer. - A slide that can wait is held until the reply pauses (no chunk for a second). A spacer coming into view is still committed in the frame that shows it. - A transition a stream starts under is finished synchronously instead. - A full mount a reader is waiting on goes in small synchronous passes. - The reply being written is not measured mid-stream: each chunk moved the height estimate, and with it every spacer, on every frame.
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 |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? 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". |
[skip ci]
## Summary The `pinned-symbol matrix (vLLM, TRL, PEFT, ST, bitsandbytes, transformers)` job fails on any PR that runs it (seen in the staging run for #17597): ``` FAILED tests/version_compat/test_peft_conversion_symbol_backfill.py::test_the_fused_snapshot_matches_upstream E AssertionError: fused MoE types missing from the snapshot: ['Dots3NoteTextModel'] ``` That test is a canary. It reads transformers' `conversion_mapping.py` on `main` and checks that every fused MoE alias in it is also in `_PEFT_MOE_CONVERSION_PATTERNS` in `unsloth/import_fixes.py`, the snapshot used when the live map is not available. transformers added a new alias today in huggingface/transformers#47844 (dots3-note Preview support): ```python "Dots3NoteTextModel": "qwen2_moe", ``` Like the `UnlimitedOcrTextModel` entry already in the snapshot, it is keyed by class name rather than model type. The canary is right: without the entry, the stand-in map would let a fused dots3-note checkpoint fall through without its MoE conversion. ## Change `unsloth/import_fixes.py`: `"Dots3NoteTextModel": "qwen2_moe"` added to `_PEFT_MOE_CONVERSION_PATTERNS`, next to the other class-keyed alias, with a comment saying where it comes from. ## Testing - `tests/version_compat/test_peft_conversion_symbol_backfill.py` against the live upstream map: 69 passed. - With main's `import_fixes.py`, `test_the_fused_snapshot_matches_upstream` fails with the error above.
|
@codex review |
1 similar comment
|
@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". |
[skip ci]
Problem
#17504 mounts only the messages near the reader. A window slide that is not urgent goes out as a React transition, and every streamed chunk is a synchronous store update, so React restarts that transition from the root on each chunk. A slide issued while a reply streams therefore re-rendered its rows (markdown, KaTeX) for every chunk and landed only after the reply ended. A reader who scrolled up during a reply looked at an empty spacer until it finished, and the wasted renders showed up as main-thread time:
stream_cost_ms_per_kchar229 -> 744 (+226%),stream_busy_pct6.4 -> 19.6, null-controlled.scroll_during_generationparks the reader away from the reply (blocked 3241-3410 ms per 8 s vs 328-374 on base); windows where the reader follows the reply were at or below base.Fix
Windowing stays; only what happens while a reply streams changes (
progressive-messages.tsx,thread-window.ts):TailPulse), instead of starting a transition that cannot land.Results
studiobench standard 100K, 4 reps, null-controlled, base = main before #17504, treatment = this fix:
Behaviour parity: 20 invariants held, 0 broken. The select-all copy cost (every unmounted row is mounted before the clipboard fills) is left for a follow-up that builds the clipboard from the message store.
CI: compare long-chat cost with the base build
The existing long-chat gate compares a build with itself (40 vs 200 turns), so it passed #17504.
tests/studio/long_thread_ab.pybuilds the PR's base too and runs the same 200-turn chat on both builds, alternating on fresh pages: streaming a reply, typing, scrolling, and a reply streaming while the reader wheels away and then stops to read. It fails when head's median main-thread or long-task time is over 1.5x base with no overlap, or when any head reading leaves the viewport blank while base stayed filled. A new step instudio-frontend-ci.ymlruns it on pull requests (5 reps per side, a few minutes; a base that cannot build with the PR's node_modules is a warning).Validated on clean runners (scroll-away area, 5 reps each):
Every bisected #17504 commit also measured below its base on stream, typing and scrolling CPU, so the check gates on what readers see as well as on time.
Tests
npx tsc --noEmit -p .clean;tests/thread-window.test.tsandtests/progressive-mount-glue.test.ts88 pass, including new tests forTailPulseand the deferral.tests/studio/playwright_thread_window.pycheck 14: wheel away from a 600-chunk streaming reply, rows must cover the reader 20 frames later while it still streams; fails on main, passes here.Declared UI difference (
affects UI#)studiobench's visible-region parity reports one difference, in
stop_generation: base shows message 19 on screen during the action, this PR does not. A per-frame trace (IntersectionObserver entries, scrolls, mounts) shows why. On main, when Enter jumps to the bottom, the finished reply is still mounted at a stale mid-stream height (675 px against a real 1371 px), so the jump lands about 700 px short for one frame: message 19 sits at -3..123 px for about 25 ms, then the scroll follows to the true bottom. This PR mounts the reply at its real height in the same frame as the jump, so it lands on the settled view directly; message 19 is mounted, just above the viewport, and no frame shows a spacer. The null control (main against main) shows the same one-frame flash on every cell. Every behavioural invariant holds, the structural mode is clean, and the final screenshots match.The long-chat check moved to its own job (
Long-chat cost against the base build): the build job already runs 29 to 35 minutes against its 40 minute timeout.Before / after
Two isolated Studio installs (merge base
b2784e3e6, this PR), the same 400-message chat, a reply streamed into it (answered in the page, no model), the reader wheels up 12 steps and stops while it streams. Each side ran 6 attempts and shows its emptiest one. Before: the viewport was empty in 1 of 6 attempts (rows filled 0% of it). After: filled in 6 of 6.