Repository navigation
Studio: Respect the thinking budget on /v1/messages - #11724
Conversation
…i#11735) * Count the stripper's whole-buffer work instead of timing it test_early_markup_is_not_slower_than_the_code_it_replaces compared CPU time against the reference strip with a 10% margin. With markup at the front and nothing settled the two arms do the same strip, so the ratio sits at 1.0 and runner noise alone spans 0.89 to 1.09; it failed on unslothai#11724, which does not touch the stripper, at 0.444s against 0.404s. The regression it guards, paying the whole-buffer checks on every token, measured 1.11 to 1.33, so no margin separates it from the noise. Count the work instead: no token pays _needs_whole_buffer, and _full_strip reads no more text than the reference. A second case puts the markup at offset 0, which reaches the degenerate branch the timed version never exercised. * Count the passes inside the strip, in both arms Counting only _full_strip's argument could not see a second strip or scan inside it. Count the characters each arm hands to strip_outside_think and strip_segment, and to the blocked-body masking, and hold the incremental arm to the reference's totals. A doubled strip_outside_think or masking pass now fails with the counts that grew.
…nslothai#11741) * studiobench: compare a code fence one arm scrolled past on its text The UI parity gate failed on backend-only pull requests (unslothai#11724, unslothai#11727, and others on 2026-09-23) with differences like msg15(assistant):1847269->2150610c on model_change, reasoning_toggle, select_all_copy, settings and image_upload at r100K. Those are not rendering differences. code-fence-defer.tsx (unslothai#9462, the default since unslothai#9567) renders a fence as a plain shell until it first comes within a viewport of the reader, then highlights it for the rest of the mount. After reasoning_toggle the r100K film leaves the viewport either near the tail (scrollTop ~50,740) or about 20,000px higher, at random per cell on one build (78 of 172 cells across 43 recorded payloads), and the higher landing latches the fences of msg11/13/15 until thread_reopen remounts them. A null control whose cells all landed low measured those actions stable, so the result's latch noise was scored as a regression. The same noise also made a null that did see it excuse settings and model_change outright, which hid real changes there. scene/parity.js now reads, in the same walk that produces the unchanged per-message digest, each fence's latch state, full digest and text digest (whitespace dropped, since streamdown emits one span per line and the shell one text node), plus the message with every fence replaced by a marker. analysis/parity.fence_latch_residue treats a message as differing only by latch when everything outside its fences matches, every fence latched on both arms or neither matches in full, and every fence latched on one arm only matches on its text. Nothing is excused when one arm latched no fence anywhere, which is what a build whose fences never upgrade looks like. A latch-only pair is a MATCH, counted and printed, so it costs no coverage; payloads recorded before this carry no fence fields and score exactly as before. The selftest replays both failing runs from their recorded CI payloads, shows they fail as recorded and pass once the latch is recorded, and injects genuine differences (a message with no fences, a change outside a latched message's fences, a highlighting change on a fence both arms latched, fences that never upgrade) that must still fail. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * studiobench: keep a fence's spacing and language in the latch comparison The one-sided fence comparison dropped every whitespace character, so `x = 1` and `x=1`, an indentation change or a space inside a string read as the same fence, and it never looked at the language, so a fence that changed language but kept its body read as latch-only too. Drop line breaks only, the one thing that differs between the shell and the highlighted form, keep the rest of the text as it is, and record and compare each fence's data-language. * studiobench: read a fence's text as lines, not a run of characters Dropping every newline made a line break moved within the code, `a\nbc` against `ab\nc`, read as the same fence. Read both forms as lines: the shell's text split on newlines, and the highlighted fence one line per element directly inside its <code>, a blank line's lone newline dropped. Join them with one newline and drop trailing blank lines, which the shell trims. * studiobench: compare a fence's text as written, without prose placeholders The time and id placeholders are there for UI prose. Applied to a one-sided fence's source they made `"295ms"` against `"310ms"`, or two different timestamp or id literals, read as the same code. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Review + GitHub Actions evidencePinned review: I ran a real Studio (
Other checks:
|
…i#11735) * Count the stripper's whole-buffer work instead of timing it test_early_markup_is_not_slower_than_the_code_it_replaces compared CPU time against the reference strip with a 10% margin. With markup at the front and nothing settled the two arms do the same strip, so the ratio sits at 1.0 and runner noise alone spans 0.89 to 1.09; it failed on unslothai#11724, which does not touch the stripper, at 0.444s against 0.404s. The regression it guards, paying the whole-buffer checks on every token, measured 1.11 to 1.33, so no margin separates it from the noise. Count the work instead: no token pays _needs_whole_buffer, and _full_strip reads no more text than the reference. A second case puts the markup at offset 0, which reaches the degenerate branch the timed version never exercised. * Count the passes inside the strip, in both arms Counting only _full_strip's argument could not see a second strip or scan inside it. Count the characters each arm hands to strip_outside_think and strip_segment, and to the blocked-body masking, and hold the incremental arm to the reference's totals. A doubled strip_outside_think or masking pass now fails with the counts that grew.
…nslothai#11741) * studiobench: compare a code fence one arm scrolled past on its text The UI parity gate failed on backend-only pull requests (unslothai#11724, unslothai#11727, and others on 2026-09-23) with differences like msg15(assistant):1847269->2150610c on model_change, reasoning_toggle, select_all_copy, settings and image_upload at r100K. Those are not rendering differences. code-fence-defer.tsx (unslothai#9462, the default since unslothai#9567) renders a fence as a plain shell until it first comes within a viewport of the reader, then highlights it for the rest of the mount. After reasoning_toggle the r100K film leaves the viewport either near the tail (scrollTop ~50,740) or about 20,000px higher, at random per cell on one build (78 of 172 cells across 43 recorded payloads), and the higher landing latches the fences of msg11/13/15 until thread_reopen remounts them. A null control whose cells all landed low measured those actions stable, so the result's latch noise was scored as a regression. The same noise also made a null that did see it excuse settings and model_change outright, which hid real changes there. scene/parity.js now reads, in the same walk that produces the unchanged per-message digest, each fence's latch state, full digest and text digest (whitespace dropped, since streamdown emits one span per line and the shell one text node), plus the message with every fence replaced by a marker. analysis/parity.fence_latch_residue treats a message as differing only by latch when everything outside its fences matches, every fence latched on both arms or neither matches in full, and every fence latched on one arm only matches on its text. Nothing is excused when one arm latched no fence anywhere, which is what a build whose fences never upgrade looks like. A latch-only pair is a MATCH, counted and printed, so it costs no coverage; payloads recorded before this carry no fence fields and score exactly as before. The selftest replays both failing runs from their recorded CI payloads, shows they fail as recorded and pass once the latch is recorded, and injects genuine differences (a message with no fences, a change outside a latched message's fences, a highlighting change on a fence both arms latched, fences that never upgrade) that must still fail. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * studiobench: keep a fence's spacing and language in the latch comparison The one-sided fence comparison dropped every whitespace character, so `x = 1` and `x=1`, an indentation change or a space inside a string read as the same fence, and it never looked at the language, so a fence that changed language but kept its body read as latch-only too. Drop line breaks only, the one thing that differs between the shell and the highlighted form, keep the rest of the text as it is, and record and compare each fence's data-language. * studiobench: read a fence's text as lines, not a run of characters Dropping every newline made a line break moved within the code, `a\nbc` against `ab\nc`, read as the same fence. Read both forms as lines: the shell's text split on newlines, and the highlighted fence one line per element directly inside its <code>, a blank line's lone newline dropped. Join them with one newline and drop trailing blank lines, which the shell trims. * studiobench: compare a fence's text as written, without prose placeholders The time and id placeholders are there for UI prose. Applied to a one-sided fence's source they made `"295ms"` against `"310ms"`, or two different timestamp or id literals, read as the same code. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
|
Review record for #11724, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#209. Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found. Round 1: reviewed mirror
|
Requests to
/v1/messagescould set a thinking budget withbudget_tokens, but Studio threw it away, so the model thought for as long as it liked. With a smallmax_tokens, a reply could end before any answer was written.Studio now passes the budget on to the model when thinking is on. Requests without a budget, or with thinking off, behave as before. This follows #9107.