Repository navigation
Conversation
A token that extends the previous grapheme cluster (a combining mark, a ZWJ emoji sequence, an Indic vowel sign) was compared Character by Character, so streamed text was emitted again. Compare and slice Unicode scalars in the vanilla, constrained and pipelined constrained strategies. Co-authored-by: Marco Iannello <148067382+iannellomarco@users.noreply.github.com>
hkarmoush
force-pushed
the
hkarmoush-fix-stream-grapheme-delta
branch
from
December 1, 2026 08:22
bbc8c67 to
477975c
Compare
Contributor
|
Thank you for the PR However "Fixes #315." is an over claim, we will still have follow ups. Let's merge this for the cases that you have, though. These are real fixes. |
stikves
approved these changes
Dec 4, 2026
Contributor
Author
|
The lint and python-test-Mac failures look like a runner problem rather than the change: every step in both jobs passed and only the "Complete runner" step failed. Could someone re-run those two jobs? I don't have permission to. |
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.
Type of Change
Motivation and Context
Refs #315.
When a token extends the previous grapheme cluster, comparing by
Characterre-emits text that was already streamed. The vanilla, constrained and pipelined constrained strategies now compare and slice Unicode scalars.This starts from the
sukru/fix-issue-315branch (originally #342 by @iannellomarco), moved onto current main. The one conflict was inVanillaDecodingStrategy, where the delta code now sits inside theif knownblock.#564 also edits these files. Git merges the two cleanly, but it renames the
stopSequences:argument todecoderOptions:, so whichever lands second needs the new test file updated. I can rebase if #564 goes in first.I left out the streaming loops in
CoreAILanguageModelandCoreAIVisionLanguageModel. They also usecommonPrefix(with:), but they decode a short sliding window, and in a simulation they also lost text after a split character, so a scalar diff alone may not be enough.llm-runnerhas its owndropFirst(previousText.count)diff too. I can look at those separately.Testing
I couldn't build or run the package: it needs Xcode 27 and I have 26.6, so the new tests haven't run yet.
What I did run:
swift format lint --strict --recursive swift/Sources/ swift/Tests/passes.