Repository navigation
Studio: turn on the grid-based reasoning collapse - #9511
Merged
Merged
Conversation
PR #9423 replaced Radix's measured-height collapsible with a local grid primitive that never measures, and merged behind GRID_COLLAPSE_REASONING_ENABLED defaulting off. The flag has been off ever since, so nobody has been getting the improvement. This turns it on. The flag file said OFF until the A/B has run, and asked for screenshots as well as a parity digest because the change adds one wrapper element. Both have now been done on current main.
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. 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". |
Member
Author
|
@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". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #9423 replaced Radix's measured-height collapsible with a local grid primitive that never measures, and merged behind
GRID_COLLAPSE_REASONING_ENABLEDdefaulting off. The flag has been off ever since, so nobody has been getting the improvement. This turns it on.The flag file itself said "OFF until the A/B has run", and asked for screenshots as well as a parity digest because the change adds one wrapper element to the DOM. Both have now been done, on current main.
The mechanism
Radix's
CollapsibleContentImplruns auseLayoutEffectthat writestransitionDuration: 0sandanimationName: none, readsgetBoundingClientRect(), then writes the styles back, on everyopenchange, unconditionally, whether or not any stylesheet consumes the--radix-collapsible-content-heightit produces. That read is a synchronous full-document layout, and Blink's layout is O(total layout objects) rather than O(dirty objects), so on a long thread it is charged the whole document. The grid primitive transitionsgrid-template-rowsfrom0frto1frand never measures.What was measured
studiobench standard tier, 100K rung,
--reps 4split into two independent waves of two repetitions, in headless Chromium (--engine chromium, read back fromrun_meta.platform.enginein each payload rather than trusted from the command line).Both arms are production
npm run buildbundles served by the Studio backend with--frontend, each with its ownUNSLOTH_STUDIO_HOMEand port, never a shared--home. The two dists differ only in this one boolean: base746ad086dbundle sha2567e6c4a2ff23be5a9, flag-on8ef4bcfc7bundle0aeee6754062b578. Every payload passed--assert-liveness.Each wave carried its own null control, base against base, identical bytes, running as one of the concurrent jobs so the floor sees the same contention the result does. Wave 0's floor is not wave 1's floor, and neither is quoted against the other.
The result, both waves
reasoning_toggle.open_msreasoning_toggle.open_msjank_indexjank_indextime_in_jank_pcttime_in_jank_pctreasoning_toggle.close_msreasoning_toggle.close_msThe claim is deliberately narrow.
reasoning_toggle.open_msis the only metric that cleared all three gates in both waves. The jank index cleared in wave 0 and fell under its floor in wave 1, so it is reported and not claimed. Opening a reasoning pane on a long thread gets meaningfully cheaper; nothing else was shown to move.The magnitude differs between waves, -33.6% and -20.6%, and wave 0's spread (30.2%) is close to its own delta. Wave 1 is the tighter measurement (spread 4.7%). Treat the effect as "roughly a fifth to a third off", not as a precise figure.
Nothing regressed past its floor in either wave. Two
SLOWERrows appear in wave 0 onscroll_after.gesture_msandscroll_after.per_step_ms, both+0.0%against a0.0%floor; that is the scroll gesture's fixed step cadence, not a regression.Provenance of the original numbers
PR #9423 reported -24.8% and -21.1% at n=8. Those are the original author's figures on an older tree and are quoted here as history. They have not been re-measured. The table above is fresh measurement on current main.
Parity
sweep/ui_parity.py,--mode digest, scored against the null control from the same run:The null reporting 0 in both waves is what makes the non-zero readings trustworthy rather than noise. The difference is real, it persists under
--mode visible, so it cannot take the off-screen exemption, and it needs explaining rather than waving through.It is a per-message structural signature that is exactly 209 characters shorter, identically on every assistant message carrying a reasoning pane, in every stable action and both repetitions. Note that
parity.jsrecordschars: sig.length, the length of the normalised structural signature, not visible text.Measured directly, by serving both dists side by side and computing the signature with the harness's own
window.__sb.parity.signatureon a seeded 23,868-character reasoning trace: 100% of the delta is inside[data-slot="reasoning-root"], on the single[data-slot="reasoning-content"]div, and it accounts to the byte:classvalue: Radix's 8 animation/duration tokens replaced by 4 grid tokensstyle=*presence token, Radix emitsstyle, the grid primitive emits nonemin-h-0 overflow-hiddenwrapper element and its close tagThe expanded pane gives -211, because the grid class swaps
hidden(6) forgrid(4). The digest's 209 is the collapsed pane, which is what a seeded thread shows by default.What the user sees
textContentis byte-identical on both arms: 21 characters collapsed ("Thought for 0 seconds"), 23,965 characters expanded, and identical again after re-collapsing.376de7f5e49873048eab4f13a9b9ea31).1frto exactly the height Radix measures.data-state,data-variant,aria-expanded, thehiddenattribute and the trigger label are identical in every state.Accessibility
Same ARIA attribute count and set. One value differs:
aria-controlsisradix-_r_8j_on the Radix arm and_r_8j_on the grid arm, because Radix prefixes its generated id and the local primitive uses a bareuseId(). On both arms it resolves to the same element, so the control relationship is intact, and bothidandaria-controlsare in the digest'sVOLATILE_ATTRS, which is why this contributes 0 of the 209. No role or landmark changes. The extra wrapper carries no role, no ARIA and no id, so an AT tree flattens it.One behavioural difference the digest cannot express
On the grid arm the content div and its wrapper stay in the DOM while closed, 11 elements against 10, whereas Radix unmounts the content entirely. Children are unmounted on both arms, so no message text is retained by a closed pane.
Tests
npm testinstudio/frontend: 4279 passing, 0 failing.tsc --noEmitclean.tests/reasoning-grid-collapse.test.tsasserted the flag wasfalse. It now assertstrue, kept as an assertion rather than deleted so the value stays a reviewed choice and cannot drift silently in either direction.