Skip to content

fix: stop false link-definition probes forcing full-document renders - #10688

Merged
danielhanchen merged 3 commits into
unslothai:mainfrom
apurv-1:fix/10529-link-definition-probe-scope
Oct 5, 2026
Merged

danielhanchen merged 3 commits into
unslothai:mainfrom
apurv-1:fix/10529-link-definition-probe-scope

Conversation

@apurv-1

@apurv-1 apurv-1 commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The hold-set now reuses the same cached Streamdown split documentProse already uses, so a list-nested list[str]: no longer stalls the tail onto the sticky full-document path.
  • Container definitions Streamdown/Marked still register (- [foo]: /url, > [foo]: /url, nested lists) still hold.

Fixes #10529

Test plan

  • studio/frontend streaming-render-schedule and link-definition-oracle tests
  • tests/streaming-latex-retro-edit.test.ts
  • tests/streaming-open-fence-repair.test.ts
  • tests/escaped-inline-math.test.ts

@apurv-1
apurv-1 force-pushed the fix/10529-link-definition-probe-scope branch from fe99ebd to 41b330d Compare September 14, 2026 11:24
@apurv-1

apurv-1 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main.

The hold-set now uses the same cached Streamdown split documentProse already has, instead of a second fence walk. list[str]: inside a list-nested fence no longer stalls the tail; a live [ref] / [ref]: url pair inside a list or quote still holds, which is the #9540 / #9633 direction.

The repaired-document scope change is in #10924 so the two can be measured apart. Incremental replies that stay on the blocks path are unchanged in this PR.

…the scope lex when the tail has none

Resolves conflicts with the widened link probes on main. The per-line hold-set
missed multi-line labels main now admits, so the hold uses the block-local
documentProse test instead, and update() skips the whole-reply scope lex when the
live tail holds no ]: since nothing committed can be a definition.
@danielhanchen

Copy link
Copy Markdown
Member

Merged main (conflicts with the widened link probes from #9645 / #11375) and pushed 5fd79e1 on top of this branch:

  • The hold-set now uses the same test documentProse uses, applied to the block itself (!isCodeBlock(block) && LINK_DEFINITION_LINE_RE.test(block)). The per-line set from the full split missed multi-line labels, which main's probe now admits ([x\ny]: /url); that case is added to the hold test.
  • Since nothing committed can now be a prose definition, update() only runs the whole-reply scope lex while the live tail still contains a ]:.

Measured per streamed 24-char chunk (cache update + render key + block split, median of 3), reply with See [a][ref]. plus the shape:

reply shape main this PR
9.4k list-nested fenced list[str]: 1008us 99us
9.3k d["key"]: int 1308us 40us
9.4k top-level fenced list[str]: 153us 40us
9.3k none 26us 37us
57k list-nested fenced list[str]: 2193us 38us
57k d["key"]: int 1996us 39us
57k top-level fenced list[str]: 784us 41us
57k none 30us 42us

The new list-nested and unfenced tests fail with main's probe restored. The frontend suite passes (2 timing tests flaked under full-suite load and pass in isolation). A randomized stream over definitions in lists, quotes, fences, HTML, tables and multi-line labels found 0 of 4315 document-scope prefixes with anything committed.

danielhanchen added a commit to apurv-1/unsloth that referenced this pull request Oct 5, 2026
… non-sticky

Resolve conflicts toward main: the link probe rewrites on main (unslothai#9645,
unslothai#11375) replace unslothai#10688's hunks, and the repaired-document scope does not
depend on them. A reference that remend closes early now renders as one
document, but only a source-level pair enters the sticky full-document
path, so a stream that abandons the reference returns to blocks.
@shimmyshimmer

Copy link
Copy Markdown
Member

Review record for #10688, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#414.

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 8c043947a (no equivalent commit found on this PR)

chatgpt-codex-connector[bot] (on the mirror)

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 8c043947a6

No triage reaction was recorded on the mirror

Verdict

The round converged at mirror 8c043947a (no equivalent commit found on this PR).

This is the review as it stood at that commit. Anything pushed to this PR afterwards was not part of it.

@danielhanchen
danielhanchen merged commit df4eb29 into unslothai:main Oct 5, 2026
danielhanchen added a commit to apurv-1/unsloth that referenced this pull request Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio: an unanchored link definition probe can put an ordinary reply on the full-document render path

3 participants